Tech Support > Microsoft Windows > Schedules Tasks and Network Drives
Schedules Tasks and Network Drives
Posted by saqib ali on January 24th, 2006


I have a few Windows XP / 2003 Server machine that need run a schedule
task overnite. The schedule task needs to access mapped network drive.


The mapped drive are personal storage for the userid under which the
scheduled task is running. However I have noticed that if the user is
not interactively logged in, the drive mapping does not take place for
schedule task.

I have even tried to map drives using Group Policies for the server. But
the scheduled tasks are still unable to see the drive mappings.

I guess I can use UNC path instead of drive for Scheduling task, but
that would mean we would have to modify our application settings for
each user i.e. to reference their personal storage.

Any ideas?

Saqib Ali
http://www.xml-dev.com/blog/



Posted by Pegasus \(MVP\) on January 24th, 2006



"saqib ali" <docbook.xml@gmail.com> wrote in message
news:OFObrhRIGHA.524@TK2MSFTNGP09.phx.gbl...
You must run the scheduled task under an account that has
sufficient access privileges for the shared resource.



Posted by saqib ali on January 24th, 2006


Yup account all have sufficient privileges for the shared resources. It
is just that the network drives don't get mapped.


Saqib Ali
http://www.xml-dev.com/blog/

Posted by saqib ali on January 24th, 2006


Yup account all have sufficient privileges for the shared resources. It
is just that the network drives don't get mapped.


Saqib Ali
http://www.xml-dev.com/blog/

Posted by saqib ali on January 24th, 2006




The scheduled task completes successfully if I use the UNC instead of
the drive letter mapping. So the account has sufficient priveleges to
write files to the shared resource.

Posted by Pegasus \(MVP\) on January 25th, 2006



"saqib ali" <docbook.xml@gmail.com> wrote in message
news:un9%23pTUIGHA.1132@TK2MSFTNGP10.phx.gbl...
This makes no sense. It's now time for you to add some
diagnostics so that you see what's ***really*** going on.
Instead of scheduling a "net use" command, schedule the
following batch file:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
net use q: \\YourServer\YourShare 1>>c:\test.log 2>c:\test.err
net use 1>>c:\test.log 2>c:\test.err
echo %date% %time% End of task >> c:\test.log

Paste the contents of the two log files into your reply.



Posted by Dave Patrick on January 25th, 2006


Correct, mapped drives won't exist when no one is logged on. Always use UNC
paths.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"saqib ali" wrote:
|
| > You must run the scheduled task under an account that has
| > sufficient access privileges for the shared resource.
|
|
| The scheduled task completes successfully if I use the UNC instead of
| the drive letter mapping. So the account has sufficient priveleges to
| write files to the shared resource.


Posted by saqib ali on January 25th, 2006


Hi Dave,

Thanks for the response. That was the verification that I was looking
for. I just wanted to make sure that I am not missing something obvious.

Anyways here is how I got around the drive mapping issue:

I use the following cmd line in the scheduler:

cmd \C net use x: /delete && cmd \C net use x:
\\fileserver\share\vol\%username% && x:\app.exe

(watch for line wraps)

1) disconnect from X: if needed
2) map X: to \\fileserver\share\vol\%username%
3) Launch application from X:

This is seems to work fine.

In Peace,
Saqib Ali
http://www.xml-dev.com/blog/

Dave Patrick wrote:

Posted by Pegasus \(MVP\) on January 25th, 2006


It seems someone forgot to tell my Win2000 PC that mapped
drives won't exist when no one is logged on. They certainly do -
I just ran a little test to confirm it. While UNC paths might be
preferable, they are not compulsory.


"Dave Patrick" <DSPatrick@nospam.gmail.com> wrote in message
news:OV7WUIVIGHA.3460@TK2MSFTNGP12.phx.gbl...


Posted by Dave Patrick on January 25th, 2006


AFAIK without some sort of trickery mapped drives are user profile specific
and not machine specific so unless you used one of these methods (or
similar) it doesn't happen as standard issue.

http://support.microsoft.com/default.aspx?scid=kb;[LN];243486

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Pegasus (MVP)" wrote:
| It seems someone forgot to tell my Win2000 PC that mapped
| drives won't exist when no one is logged on. They certainly do -
| I just ran a little test to confirm it. While UNC paths might be
| preferable, they are not compulsory.


Posted by saqib ali on January 25th, 2006


Pegasus (MVP) wrote:
See
http://www.microsoft.com/technet/pro...6760c1c15.mspx

------------------- From the above TechNet article ------------
Connecting to network drives

Do not use a redirected drive for scheduled jobs that access the
network. The Schedule service might not be able to access the redirected
drive, or the redirected drive might not be present if a different user
is logged on at the time the scheduled task runs. Instead, use UNC paths
for scheduled jobs. For example:

at 1:00pm my_backup \\server\share"
---------------------------------------------------------------

In Peace,
Saqib Ali
http://www.xml-dev.com/blog/

Posted by Pegasus \(MVP\) on January 25th, 2006


It is ***preferable*** to use UNC paths. If you wish to use
a fixed drive letter then that letter might not be available because
it is used in a different session. However, if the drive letter is free
then it can be used by a scheduled task, without any trickery
whatsoever. The statement "mapped drives won't exist when
no one is logged on" is definitely incorrect.

Mapped drives are indeed profile-specific: They can only be
seen within the context under which they were mapped.
Again this does not prevent a scheduled task from mapping
its own drive letter.



"Dave Patrick" <DSPatrick@nospam.gmail.com> wrote in message
news:OMt$meVIGHA.2696@TK2MSFTNGP14.phx.gbl...


Posted by Dave Patrick on January 25th, 2006


"Pegasus (MVP)" wrote:
| It is ***preferable*** to use UNC paths.
* Agreed. That's what I always recommend.

If you wish to use
| a fixed drive letter then that letter might not be available because
| it is used in a different session.
* I really can't see a reason why risk this.


However, if the drive letter is free
| then it can be used by a scheduled task, without any trickery
| whatsoever. The statement "mapped drives won't exist when
| no one is logged on" is definitely incorrect.
* 99% of users that post here with this same issue expect that drive letters
mapped during the logon session will also exist when they're logged off
which is definitely incorrect. To be more specific I should have said.
"mapped drives won't natively exist when no one is logged on"


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


Posted by Pegasus \(MVP\) on January 25th, 2006


How nice - we've reached full agreement! :-)

"Dave Patrick" <DSPatrick@nospam.gmail.com> wrote in message
news:utEVjDWIGHA.2668@tk2msftngp13.phx.gbl...


Posted by Dave Patrick on January 25th, 2006


Yepper!

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Pegasus (MVP)" wrote:
| How nice - we've reached full agreement! :-)



Similar Posts