Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Permission Denied - Code 800A0046 - Copiend the Documents Folder

Status
Not open for further replies.

NYCROB

MIS
Oct 30, 2022
2
US
'I can not seem to backup my Documents under windows 10 - Help


'Creates Today's Date and Computer Name
Dim ComputerName
Dim dtmvalue
Dim strDate
dtmValue = Now()
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set FSO = CreateObject("Scripting.FileSystemObject")


ComputerName = WshNetwork.ComputerName
strDate = "E:\" & Month(dtmValue)& "-"&Day(dtmValue)&"-"&Year(dtmValue)&" "&(WshNetwork.ComputerName)
if FSO.FolderExists(strDate) Then
Else
FSO.CreateFolder(strDate)
End if


'Documents

Dim DocT
Dim Mfiles
Dim DocS
Dim MB

DocT = strDate&"\"&"Documents\"
if FSO.FolderExists (DocT) Then
Else
FSO.CreateFolder (DocT)
End If

Set oShell = CreateObject("WScript.Shell")
Set Mfiles = CreateObject("Scripting.FileSystemObject")
Set MB = CreateObject("Wscript.Shell")


strHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
DocS = strHomeFolder&"\Documents\*.*"
Wscript.echo Mfiles.folderexists DocS
WScript.echo Mfiles.folderexists DocT
Mfiles.CopyFolder DocS, DocT, True
MB.Popup "Your Documents Folder has been Backup Succesfully", 5, "Documents Folder", 64+4096
 
Almost at the End When it copies the files

Mfiles.CopyFolder DocS, DocT, True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top