Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
VB script does not run under scheduled task for mapped network drive
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
JAW  
View profile  
 More options Nov 4 2009, 1:02 pm
Newsgroups: microsoft.public.windows.server.scripting
From: JAW <jwill...@aglresources.com>
Date: Wed, 4 Nov 2009 10:02:13 -0800 (PST)
Local: Wed, Nov 4 2009 1:02 pm
Subject: VB script does not run under scheduled task for mapped network drive
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 4 2009, 2:01 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Wed, 4 Nov 2009 20:01:59 +0100
Local: Wed, Nov 4 2009 2:01 pm
Subject: Re: VB script does not run under scheduled task for mapped network drive

"JAW" <jwill...@aglresources.com> wrote in message

news:f9c04786-aa9c-48de-8d65-121575e55cea@m38g2000yqd.googlegroups.com...

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.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "VB script does not run under scheduled task for mapped network dri" by jford
jford  
View profile  
 More options Nov 6 2009, 8:02 am
Newsgroups: microsoft.public.windows.server.scripting
From: jford <jf...@discussions.microsoft.com>
Date: Fri, 6 Nov 2009 05:02:01 -0800
Local: Fri, Nov 6 2009 8:02 am
Subject: RE: VB script does not run under scheduled task for mapped network dri
It works, but possibly Pegasus can correct my bad scripting habits

@echo off

set loc1="C:\Program Files\Microsoft Office\Office11\OIS.exe"
set loc2="C:\Program Files\Microsoft Office\Office12\OIS.exe"
set loc3="C:\program files\Microsoft Office\ART\Office12\OIS.exe"

if exist %loc1% (
   call :regadd %loc1%
)
if exist %loc2% (
   call :regadd %loc2%
)
if exist %loc3% (
   call :regadd %loc3%
)
goto end
:regadd
reg add <keyname> /v <valuename> /d %1
:end


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 6 2009, 8:30 am
Newsgroups: microsoft.public.windows.server.scripting
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Fri, 6 Nov 2009 14:30:56 +0100
Local: Fri, Nov 6 2009 8:30 am
Subject: Re: VB script does not run under scheduled task for mapped network dri

The OP's post dealt with the question of using a scheduled task to copy some
files from here to there. Your response deals with a registry hack. I am
unable to see any connection between the two.

"jford" <jf...@discussions.microsoft.com> wrote in message

news:F9FC7D52-CE94-487A-8F48-B9FEC59507E2@microsoft.com...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »