in
messagenews:
[email protected]...
:
Also don't forget if the job connects to another machine you may need
to
add
the user/ group 'logon as batch job' rights (server side). Control
Panel|Admin Tools|Local Security Policy\Local Policies\User Rights
Assignments
"Log on as a batch job"
--
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
Thanks to you both. I actually got it to work - feel a bit stupid
about
this but noticed that I had left the "$" out of the unc path (duh.)
I'll
be
back if that wasn't the problem (I'll know tomorrow morning as these
are
scheduledto run overnight.)
Thanks for the feedback. It actually leaves me mystified because
I cannot reconcile it with this phrase from your initial post: "When
I log onto server A and run the batch file it works; when I use
the taskscheduler to run the batch it fails."
I am in a similar situation as the original poster. A task cannot get
access to a mapped drive if I run it as a scheduled task in a
Windows-2000 server. On the other hand, the task can get access to
the mapped drive if I run it interactively through the command
prompt. Both cases are running under the same user account and
password.
The exactly same task runs perfectly fine as a scheduled task in other
two servers (Wndows 2003). And it runs fine in as a scheduled task as
of last week in that Windows-2000 server. Something might have
changed during the weekend or on Monday.
Last time (years ago) when I had this same problem, I fixed the
problem by making sure I used the same user account that I used to
startup the server to run the scheduled task (something to do with
allowing the scheduled task to get access to the user desktop). This
also might or might not have to do with the capitalization of the user
name (I might have confused this with the use of RSH in Unix); I use
exactly the same capitalization for startup logon and scheduled task
any way to play safe. This works -- at least up to last week.
Somehow, this doesn't work now for that Windows-2000 server.
I can re-create this problem by scheduling a simple task like this in
the Windows-2000 server:
cmd /c dir S:\ > C:\Temp\JayTest.txt
Here, S: is the mapped drive letter. If I run it through a command
prompt, it saves the file listing of S:\ to a text file. If I run it
as a scheduled task, it creates an empty file. The same command works
fine as a scheduled task in the other two servers (Windows 2003).
I have asked around, and no one has changed anything on that server.
Therefore, I really don't know what caused this problem.
The alternative is to use UNC. But this would mean that I need to
customize the scheduled task for each branch office because the same
drive letter is mapped to different shared folder for each branch
office. The original idea of using a mapped drive letter is to allow
the same program to run in all different branch offices. Yes, I can
do this by using a different mean to tell the program where it should
retrieve the info; but I prefer to figure out what goes wrong in that
Windows-2000 server; afterall, the same task works fine in other two
servers.
Thanks in advance for any suggestion.
Jay Chan