Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Плагин для восстановления файлов?! 
Author Message
Batya



PostPosted: Fri Jul 28, 2006 18:48    Post subject: Reply with quote

Блин, проверить некогда - надо бежать.
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 {Параметры}
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group