1FileName = WScript.Arguments(0) 2 3' We want to replace absolute paths with ones that are relative to the current folder 4set WshShell = WScript.CreateObject("WScript.Shell") 5CurDir = WshShell.CurrentDirectory 6OrigText = Replace(CurDir, "\", "/", 1, -1, 1) 7'Read source text file 8FileContents = GetFile(FileName) 9 10 11'replace all string In the source file 12cFileContents = Replace(FileContents, OrigText, "../..", 1, -1, 1) 13dFileContents = Replace(cFileContents, CurDir, "..\..", 1, -1, 1) 14 15' Update if different 16if dFileContents <> FileContents Then WriteFile FileName, dFileContents 17 18'Read text file 19function GetFile(FileName) 20 If FileName<>"" Then 21 Dim FS, FileStream 22 Set FS = CreateObject("Scripting.FileSystemObject") 23 on error resume Next 24 Set FileStream = FS.OpenTextFile(FileName) 25 GetFile = FileStream.ReadAll 26 End If 27End Function 28 29'Write string As a text file. 30function WriteFile(FileName, Contents) 31 Dim OutStream, FS 32 33 on error resume Next 34 Set FS = CreateObject("Scripting.FileSystemObject") 35 Set OutStream = FS.OpenTextFile(FileName, 2, True) 36 OutStream.Write Contents 37End Function