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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating file backups with Microsoft VBScript

Status
Not open for further replies.

DHZ

Programmer
Jan 21, 1999
2
0
0
US
I get a run time error when executing the following VBScript to backup specified folders including their files from the C: drive of my Windows NT 4.0 workstation to the specified folders on the specified Windows NT Server 4.0 network drive. Please help with correcting the error in the following code:<br>
<br>
'This script copies select directories from my C:\ drive to the 'designated network drive for backup<br>
<br>
Call do_backup() <br>
<br>
Function do_backup()<br>
<br>
Dim FSO, WSH<br>
<br>
Set FSO = CreateObject("Scripting.FileSystemObject")<br>
Set WSH = CreateObject("WScript.Shell")<br>
<br>
'Copyfolder copies all subfolders in the specified root directories<br>
'Copyfile copies all files in the specified root directories<br>
<br>
Msgbox "Automated backup commencing"<br>
FSO.CopyFolder "C:\junk\*.*","I:\DanZ\Backups\junk\*.*"<br>
FSO.CopyFile "C:\junk\*.* ","I:\DanZ\Backups\junk\*.*"<br>
FSO.CopyFolder C:\Visio\Drawings\*.*","I:\DanZ\Backups\_ Visio\Drawings\*.*"<br>
FSO.CopyFile C:\Visio\Drawings\*.*","I:\DanZ\Backups\_ Visio\Drawings\*.*"<br>
Msgbox "Automated backup complete."<br>
<br>
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top