Re: scheduled task can not access shared drive
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Tue, 3 Jun 2008 21:59:38 +0200
"Jay Chan" <jaykchan@xxxxxxxxxxx> wrote in message
news:a95c9932-5af5-4572-95a2-317fe5602aae@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 3, 2:50 pm, Jay Chan <jaykc...@xxxxxxxxxxx> wrote:
On May 5, 1:06 am, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"powdered_toast_man" <powderedtoast...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
in
messagenews:0CF63EA6-765B-4F6E-A6A6-9C840410DB73@xxxxxxxxxxxxxxxx
"Dave Patrick" wrote:
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
I changed the test script a bit to read this:
cmd /c net use > C:\Temp\JayTest_ShowMapDrives.txt
When I open the JayTest_ShowMapDrives.txt file, I see this:
Status Local Remote Network
-------------------------------------------------------------------
Unavailable R: \\MyServer\MyFolderA Microsoft Windows Network
Unavailable S: \\MyServer\MyFolderB Microsoft Windows Network
You can see that the status of all the mapped drives are
"Unavailable". The status should have been either "OK" or
"Disconnected".
Seem like the drive letters are there. But the scheduled task doesn't
have access to them. This is odd because the scheduled task is
running the same user account as the one that I use to boot up the
server.
Jay Chan
=======================
Don't use fixed drive letters for shares in your scheduled
tasks - use UNC coding instead.
.
- Follow-Ups:
- Re: scheduled task can not access shared drive
- From: Jay Chan
- Re: scheduled task can not access shared drive
- References:
- Re: scheduled task can not access shared drive
- From: Jay Chan
- Re: scheduled task can not access shared drive
- From: Jay Chan
- Re: scheduled task can not access shared drive
- Prev by Date: Re: scheduled task can not access shared drive
- Next by Date: Re: WinSxS, functional under 2k ?
- Previous by thread: Re: scheduled task can not access shared drive
- Next by thread: Re: scheduled task can not access shared drive
- Index(es):
Relevant Pages
|