我正在使用以下 vbscript 来备份我的文档:
If strMessage = vbYes Then
Dim FSO
Dim objShell
Dim strDesktop
Dim strDocuments
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("Wscript.Shell")
strDesktop = objShell.SpecialFolders("Desktop")
strDocuments = objShell.SpecialFolders("MyDocuments")
If FSO.DriveExists("H") Then
FSO.CopyFolder strDesktop, "H:\Desktop", True
FSO.CopyFolder strDocuments, "H:\Documents", True
Else
MsgBox("Your personal folder is not mapped. Please contact IT to have it mapped or created.")
End if
Else
MsgBox("You will be reminded again in 30 days")
End if
它工作正常,除了我在复制我的文档时遇到“权限被拒绝”错误。我想不出任何理由为什么我无法复制自己的文档....这与 Windows Script Host 有关吗?