I am a newbie to VBScript, so any help is appreciated. I am trying to
move files from one location to another. I would like to look at each
file and check to see if that file is already in the destination
location. If it is in that location I would like to echo out the file
name and the file.
Is there a way I can create an Object and go through the files one by
one?
Here is what I have so far, but this is a crude way of accomplishing
the task.
'MoveFSO.vbs
'Moves files from the jump drive to network shares
Option Explicit
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "F:\class3\*.wmf" , "O:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class3\*.jpg" , "O:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class2\*.wmf" , "N:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class2\*.jpg" , "N:\WWW\" , OverwriteExisting
Const DeleteReadOnly = True
objFSO.DeleteFile("F:\class3\*.wmf"), DeleteReadOnly
objFSO.DeleteFile("F:\class3\*.jpg"), DeleteReadOnly
objFSO.DeleteFile("F:\class2\*.wmf"), DeleteReadOnly
objFSO.DeleteFile("F:\class2\*.jpg"), DeleteReadOnly