I am trying to copy the contents of one folder to another using the following VBScript code:
set SA = CreateObject("Shell.Application")
set FolderObj = SA.NameSpace("C:\temp")
FolderObj.CopyHere "C:\HLCache\*.*" , 16+512
The thing is, in Windows 2000, this code works fine, the progress dialog appears and copies the files in the right place. I am running WSH 5.6 on that system. But in Windows XP, I receive this error message:
C:\DOCUME~1\Robert\LOCALS~1\Temp\~shlcpy.vbs(3, 1) Microsoft VBScript runtime er
ror: Object required: 'FolderObj'
I am also running WSH 5.6 on Windows XP. The same message appears for other Windows XP machines I have too. I need to use the CopyHere method as this is the only way I can have a progress indicator. But why would it work on Windows 2000 and not in XP?
Please can someone help me!