我制作了一个 VBscript 来移动 Windows 文件夹,当脚本到达用户打开的文件夹时,它会卡住。有没有办法可以更改我的脚本,使其跳过打开的文件夹并跳过打开的文件?
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