From: TimM on
You could probably use UNC paths to the file(s) rather than drive letter.
Just a thought.
--
Thanks
TimM


"RandyH" wrote:

> trying to create a scheduled tasks to copy a file from a remote server to a
> local server.
>
> I've mapped the drive to the remote server as Y:
>
> Const OverwriteExisting = TRUE
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> objFSO.CopyFile "Y:\Source\MyFile.txt" , "D:\Destination\",
> OverwriteExisting
>
> The file seems to copy, the file sizes match up, but when you try to open
> the file, it says it's corrupt.
>
> Scheduled tasks reports a status value of:
> "test.job" (FileCopy.vbs)
> Finished 4/19/2007 8:36:20 AM
> Result: The task completed with an exit code of (40010004).
>
> I can do the file copy using a batch file and it works.
>
> what am I doing wrong?
>
>
>
>