rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem ' Program : file_backup.vbs ' Version : 1.0 ' Author : Greg Griffiths (greg@greggriffiths.org) [http://www.greggriffiths.org] ' Date : 28 September 2002 ' Purpose : To replicate a simple backup batch file to copy files form a specified directory on my local computer to a remote computer. ' ' Usage : ' Just run the .vbs file to copy the files ' Known Issues : ' You may encounter issues if either of the locations for the copy do not exist, or if the drive letter you choose already exists. ' Disclaimer : ' While I wrote this code and it works for me, I take no responsibility for ANYTHING that happens when ' you run this code yourself and WILL NOT be held liable in ANY way. ' References : ' http://msdn.microsoft.com/library/en-us/script56/html/wsconCopyingFilesFolders.asp ' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsconaccessingnetworkconnections.asp ' rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem rem OPTION EXPLICIT Dim net ' object to be used to connect to the network Dim FSO ' object to be used to connect to the filestore ' create a link to the Network as an object that we can interact with. Set net = CreateObject("WScript.Network") ' call the map network drive method of the object, specifing only the drive letter and location. net.MapNetworkDrive "I:", "\\backup_server\c$" ' create our link to the filestore Set FSO = CreateObject("Scripting.FileSystemObject") ' use the copy file method to copy all the files in c:\my_data onto i:\greg_griffiths\ FSO.CopyFile "c:\my_data\*.*", "i:\greg_griffiths\"