Else\r
UseWgetEXE=false\r
End If\r
-\r
+Randomize\r
Set objArgs = WScript.Arguments\r
quote=Chr(34)\r
ScriptDir=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName))\r
End Sub\r
\r
Sub UnCompress(Archive, DestFolder)\r
+ batname = "tmp" & CStr(Int(10000*Rnd)) & ".bat"\r
wscript.echo("Extracting: " & Archive)\r
- Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+ Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Archive & quote & " -y -o" & quote & DestFolder & quote )\r
MyFile.Close\r
- Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+ Set oExec = WshShell.Exec(UtilsDir & batname)\r
Do\r
WScript.Echo OExec.StdOut.ReadLine()\r
Loop While Not OExec.StdOut.atEndOfStream\r
If FSO.FileExists(Left(Archive, Len(Archive)-3))Then \r
- Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+ Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Left(Archive, Len(Archive)-3) & quote & " -y -o" & quote & DestFolder & quote )\r
MyFile.Close\r
- Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+ Set oExec = WshShell.Exec(UtilsDir & batname)\r
Do\r
WScript.Echo OExec.StdOut.ReadLine()\r
Loop While Not OExec.StdOut.atEndOfStream\r
FSO.DeleteFile Left(Archive, Len(Archive)-3) ,true \r
End If\r
If FSO.FileExists(Left(Archive, Len(Archive)-3) & "tar")Then \r
- Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+ Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Left(Archive, Len(Archive)-3) & "tar" & quote & " -y -o" & quote & DestFolder & quote )\r
MyFile.Close\r
- Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+ Set oExec = WshShell.Exec(UtilsDir & batname)\r
Do\r
WScript.Echo OExec.StdOut.ReadLine()\r
Loop While Not OExec.StdOut.atEndOfStream\r
End If\r
\r
WScript.Sleep(500)\r
+ If FSO.FileExists(UtilsDir & batname)Then \r
+ FSO.DeleteFile UtilsDir & batname, True\r
+ End If\r
End Sub\r
\r
Sub Wget(URL, DestFolder)\r
Wscript.echo("Downloading: " & URL)\r
\r
If UseWgetEXE Then\r
- Set MyFile = fso.CreateTextFile(UtilsDir & "tmpcmd.Bat", True)\r
+ batname = "tmp" & CStr(Int(10000*Rnd)) & ".bat"\r
+ Set MyFile = fso.CreateTextFile(UtilsDir & batname, True)\r
MyFile.WriteLine("@cd " & quote & DestFolder & quote)\r
MyFile.WriteLine("@" & quote & UtilsDir & "wget.exe" & quote & " " & URL)\r
MyFile.Close\r
- Set oExec = WshShell.Exec(UtilsDir & "tmpcmd.Bat")\r
+ Set oExec = WshShell.Exec(UtilsDir & batname)\r
Do\r
WScript.Echo OExec.StdOut.ReadLine()\r
Loop While Not OExec.StdOut.atEndOfStream\r