0
문제가 있습니다. Vbscript (하나의 Run 메서드, 하나 삭제 및 moveFile 하나) 내 루프에 모든주기에 몇 가지 동기화 된 명령을 던질 필요가. 내가 어떻게하는지 모르겠다.실행 방법 동기화 vbscript
Public Function UnificarCRIs(ByVal path, ByVal FICRIEC, ByVal sessio, ByVal CIBAA)
Dim objFile, objCurrentFolder, filesys, origenFitxers
Dim FileName, WshShell
On error resume next
Set filesys = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objCurrentFolder = filesys.getFolder(path)
For Each objFile In objCurrentFolder.Files
FileName = objFile
If (right(FileName, 4) = ".cri") Then
If filesys.FileExists(path & FICRIEC & sessio) Then
'WshShell.Run ("copy " & path & FICRIEC & sessio & "+" & FileName & " " & path & FICRIEC & sessio & "_tmp")
WshShell.run ("cmd /K " & "copy /Y " & path & FICRIEC & sessio & "+" & FileName & " " & path & FICRIEC & sessio & "_tmp",8,TRUE)
Set WshShell = Nothing
filesys.DeleteFile path & FICRIEC & sessio
'filesys.MoveFile path & FICRIEC & sessio & "_tmp", path & FICRIEC & sessio
Else
WshShell.run "cmd /K " & "copy /Y " & FileName & " " & path & FICRIEC & sessio,8,TRUE
Set WshShell = Nothing
End If
End If
Next
End Function
.Run 및 bWaitOnReturn 매개 변수에 대한 문서를 읽었으며 잘 작성했다고 생각합니다. 내 방법은 다음과 같습니다. WshShell.run "cmd/K"& "copy/Y"& path_and_name_file_INPUT_1 "+"& path_and_name_file_INPUT_2 & ""& path_and_name_fileOUTPUT 1, TRUE – user2069014
나는 실수를 발견했습니다. 나는 "다음에 Errror Resume Next"와 "Set WshShell = Nothing"을 삭제했으며 작동 중입니다! 감사!!! ;-디 – user2069014