"JAW" <> wrote in message
news:f9c04786-aa9c-48de-8d65-...
>I have a script that at the end must copy a file from one server to
> another server.
>
> I mapped a network drive via NET USE and saved the credentials and it
> works great!
>
> However, when I run the job (using the same account) as a scheduled
> task the copy fails. It works fine on a local drive but not on a
> networked driver. I get a 76 return code from the the copy.
>
> Below is the area of the code that fails.
>
> ' FTP good backup copy and check for success
>
> Const OverwriteExisting = TRUE
> objFSO.CopyFile v_backup,v_xbackup,OverwriteExisting
> objFSO.CopyFile v_output,v_xoutput,OverwriteExisting
>
> v_returncode = err.number
>
> If v_Returncode = 0 then
> WScript.echo "FTP return code =" & v_ReturnCode
> Else
> WScript.echo "FTP return code =" & v_ReturnCode
> WScript.echo "FTP command errored out"
> Call emailer
> v_msg = "Process Completed: " & time
> WScript.Echo v_msg
> Wscript.Quit 1
> End If
Make sure to use UNC paths in scheduled jobs. Mapped drives do NOT exist in
scheduled jobs, unless you explicitly map them, and even then they could
fail for a number of reasons.
|