Volniy

|
Posted: Thu Jan 10, 2008 18:22 Post subject: |
|
|
Lari wrote: | НО еще плюс к этому нужно зайти в эту папку. |
Пробуй такой вариант (исправлено на основе идеи Batya)
Code: | '=========================[ Start of file ]=========================
Option Explicit
Dim CurPath, NewFolder, CurFile, FileName, NPath, TempFile, SelFile
Dim WSH, FSO
Set WSH = CreateObject ("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
CurPath = WScript.Arguments(0) '"%P"
NewFolder = WScript.Arguments(1) '"%O"
CurFile = WScript.Arguments(2) '"%L"
FileName = WScript.Arguments(3) '"%N"
If UCase(NewFolder) = UCase(FileName) Then
WScript.Quit()
End If
NPath = CurPath & NewFolder
If Not FSO.FolderExists(NPath) Then
FSO.CreateFolder NPath
End If
If FSO.FolderExists(NPath) Then
Set TempFile = FSO.OpenTextFile(CurFile, 1)
Do While Not TempFile.AtEndOfStream
Set SelFile = FSO.GetFile(TempFile.ReadLine)
If Not FSO.FileExists (NPath & "\" & SelFile.Name) Then
FSO.MoveFile SelFile.Path , NPath & "\" & SelFile.Name
End If
Loop
WSH.Run """" & "%COMMANDER_PATH%\totalcmd.exe""" _
& " /O /S /L=""" & NPath & """", 8, False
End If
WScript.Quit()
'=========================[ End of file ]=========================
|
Last edited by Volniy on Thu Jan 10, 2008 22:36; edited 1 time in total |
|