WalleyeGuy
Technical User
Hiya All,
I have a script that works perfectly on XP
Well, I need to get it to work on Vista too
Basically, it copies the contents of one folder to another
Sounds simple enough; but......
All I get is a vb runtime - file not found error
If I replace the oFSO.CopyFile... line with a WScript.Echo line it echos that line the same number of times as files are in the folder. If I suppress errors, it does not copy the files.
Any ideas?
I have a script that works perfectly on XP
Well, I need to get it to work on Vista too
Basically, it copies the contents of one folder to another
Sounds simple enough; but......
Code:
Option Explicit
Const OverWriteFiles = True
Dim oFSO,objWMI,strUserName,wshNetwork,wshShell
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set wshShell = CreateObject("Wscript.Shell")
Source = "C:\Folder1"
Destintation = "C:\Folder2"
Dim oFolder,oFile,cFiles
Set oFolder = oFSO.GetFolder(Source)
Set cFiles = oFolder.Files
For Each oFile in cFiles
oFSO.CopyFile Source, Destination, OverWriteFiles
Next
All I get is a vb runtime - file not found error
If I replace the oFSO.CopyFile... line with a WScript.Echo line it echos that line the same number of times as files are in the folder. If I suppress errors, it does not copy the files.
Any ideas?