Batya

|
Posted: Fri Jul 28, 2006 18:48 Post subject: |
|
|
Блин, проверить некогда - надо бежать.
Code: | Dim FSO, TCS, StreamFile, WSH
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TCS = CreateObject("TCScript.Helper")
Set WSH = CreateObject("WScript.Shell")
Set StreamFile = FSO.OpenTextFile(WScript.Arguments(1), 1)
Dim Selected, Exe, Arg, Args
Exe = Wscript.Arguments(0)
For i = 3 To Wscript.Arguments.Count
Args = Args & " " & Wscript.Arguments(i - 1)
Next
Do While Not StreamFile.AtEndOfStream
Selected = StreamFile.ReadLine
If FSO.FileExists(Selected) Then
WSH.Run Exe & Selected & Args
End If
If FSO.FolderExists(Selected) Then
FolderProcess(FSO.GetFolder(Selected))
End If
Loop
MsgBox("Выполнено!")
Set FSO = Nothing
Set TCS = Nothing
Set StreamFile = Nothing
Wscript.Quit()
Function FolderProcess(CurrFolder)
Dim sf, f
For Each sf in CurrFolder.SubFolders
FolderProcess(sf)
Next
For Each f in CurrFolder.Files
WSH.Run Exe & Selected & Args
Next
End Function |
Сохранить с расширением vbs, например, startset.vbs.
Запускать:
startset.vbs {Путь\nscopy.exe} %L %T {Параметры} |
|