Welcome to our community

Be apart of something great, join today!

Software VB Scripting

dexyweescot

Inactive User
Hi,

Im trying to create a backup folder from a network drive to my local machine every nite. I have a batch file deleting the local folder then this script to create and copy the network drive over.

I have used scheduled tasks the start each process. but im getting an error on my script. Can someone have a look and maybe tell me where im going wrong. here is my error and scripts.

untitled.JPG
untitled2.JPG
untitled3.JPG
 
Cant really see anything wrong with it. I've typed it up using my own paths and it's running fine.

Going further from above, remove your dim lines at the top of the scripts and replace with:

Code:
You don't have permission to view the code content. Log in or register now.
 
Last edited:
here is what i have now

dim fs
option explicit
dim originalLocation, backupLocation, createFSO, createFolder, fs
const overWriteFiles = true

'This is the path to the folder you want backed up
originalLocation = "T:\"

'This is the path to the location that you will be backing those files up to.
backupLocation = "C:\Documents and Settings\Cam2.DUCTVENT\Desktop\CAM Local test"

'Create the backup folders
Set createFSO = CreateObject("Scripting.FileSystemObject")
set createFolder = createFSO.CreateFolder(backupLocation)

set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFolder originalLocation, backupLocation, overWriteFiles
msgbox("A full backup of " & originalLocation & " completed on " & Now())

but getting this now lol

untitled6.JPG
 
still getting line 16 character 1 error though...arg!! lol

option explicit
dim originalLocation, backupLocation, createFSO, createFolder, fs
const overWriteFiles = true

'This is the path to the folder you want backed up
originalLocation = "T:\"

'This is the path to the location that you will be backing those files up to.
backupLocation = "C:\Documents and Settings\Cam2.DUCTVENT\Desktop\CAM Local test"

'Create the backup folders
Set createFSO = CreateObject("Scripting.FileSystemObject")
set createFolder = createFSO.CreateFolder(backupLocation)

set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFolder originalLocation, backupLocation
msgbox("A full backup of " & originalLocation & " completed on " & Now())

untitled4.JPG
 
Last edited:
Back
Top