Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: VB script does not run under scheduled task for mapped network drive

Reply
Thread Tools Display Modes

Re: VB script does not run under scheduled task for mapped network drive

 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      11-04-2009

"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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Vista and Hard drive recognition. 1maintenance Windows Vista Hardware 5 01-20-2008 01:52 PM
SATA - PATA Hard drive issues retired fire Windows Vista Installation 25 01-18-2008 03:36 PM
Re: Vista hard drive error check destroys a FAT 16 drive? Help! Jon Windows Vista Hardware 1 09-19-2007 02:33 AM
How to make system boot drive (removing dualboot setup) Rich Windows Vista Hardware 4 03-13-2007 06:20 PM
Vista RC2 install fails with SATA Tony Saucedo Windows Vista Installation 11 11-08-2006 08:19 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59