Hi everyone,
I was able to put together a simple script that will copy a file from one location to another. Still learning the Ins and Outs of scripting and perhaps you guys will be able to help me on this one.
Here is the script:
Dim Confirm, SourceFolder, TargetFolder
Message = "Cancelled !"
SourceFolder = "C:\TEMP\SOURCE"
TargetFolder = "D:\TEMP\TARGET"
Confirm = MsgBox("Copy Files from C:\ to D:\, would you like to proceed?", vbOKCancel + vbQuestion, "COPY FILES TEST")
if Confirm = vbCancel Then
WScript.Echo Message
WScript.Quit
End If
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder SourceFolder, TargetFolder
objFSO.DeleteFolder SourceFolder
MsgBox"File Copy Complete!"
What I would like to do now is to have a MSGBOX that will appear if the SourceFolder do not Exist.
Then Have an option to Cancel or Try again (Looping the script back at the beginning).
Perhaps you could give me an idea, an example that I could work on.
Appreciate your help on this. Thank you in advance.