Batya
|
Posted: Tue Jun 05, 2007 13:17 Post subject: |
|
|
Я бы сделал примерно так:
Code: | Dim FSO, WSH, F, TempFile, Commander_Path, Exe, Params
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = CreateObject("WScript.Shell")
Commander_Path = WSH.ExpandEnvironmentStrings("%COMMANDER_PATH%")
Exe = """" & Commander_Path + "\System\Bin\WGet\wget.exe"""
Params = " -r -c -nd --tries=1000000"
If WScript.Arguments.Count > 0 Then
F = WScript.Arguments(0)
If Not FSO.FileExists(F) Then
Set WSH = Nothing
Set FSO = Nothing
WScript.Quit
End If
Set TempFile = FSO.OpenTextFile(F, 1)
Do While Not TempFile.AtEndOfStream
File = TempFile.ReadLine
If LCase(FSO.GetExtensionName(File)) <> "url" Then
URL = InputBox("Файл " & File & " не является URL-ом." & vbNewLine & _
"Введите ссылку для скачивания", "Download Script")
If Len(URL) > 0 Then
WSH.Run Exe & Params & " " & URL, 7, False
'Else Пропускаем
End If
Else
WSH.Run Exe & " -i " & File & Params, 7, False
End If
Loop
TempFile.Close
Set TempFile = Nothing
Else
URL = InputBox("Не указаны параметры." & vbNewLine & _
"Введите ссылку для скачивания", "Download Script")
If Len(URL) > 0 Then
WSH.Run Exe & Params & " " & URL, 7, False
'Else Пропускаем
End If
End If
Set WSH = Nothing
Set FSO = Nothing
WScript.Quit |
|
|