我做了一个VB脚本来移动Windows文件夹,并且脚本到达用户打开的文件夹时卡住了。有没有办法改变我的脚本,以便跳过打开的文件夹并跳过打开的文件?如何在使用VBScript移动项目时跳过打开的文件夹(并跳过打开的文件)?
Dim fso, directory, item, group, dateStamp, NumberFilesDeleted, text, MoveFoldersErrorInfo, MoveFilesErrorInfo, objLogFile
On error resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
'Move folders in the temp folder to To_Be_Deleted folder and check for errors
fso.MoveFolder "E:\Projects\temp\*" , "E:\Projects\To_Be_Deleted"
If Err.Number <> 0 Then
MoveFoldersErrorInfo = "Error: " & Err.Number & " Error (Hex): " & Hex(Err.Number) & Err.Source & " Description: " & Err.Description
Err.Clear
End If
'Move files in the temp folder to To_Be_Deleted folder and check for errors
fso.MoveFile "E:\Projects\temp\*" , "E:\Projects\To_Be_Deleted"
If Err.Number <> 0 Then
MoveFilesErrorInfo = "Error: " & Err.Number & " Error (Hex): " & Hex(Err.Number) & Err.Source & " Description: " & Err.Description
Err.Clear
End If
你为什么要重塑'robocopy'? – 2013-03-18 19:18:18