How to switch to a mapped drive from the AT scheduler

L

leo

Hi,

I have a .bat program that renames some files on a mapped
directory. The problem I face is that when the program
runs on the AT scheduler, it does recognise the drive T or
any mapped drive. How can I get the scheduler to know what
drive T is?
Note, I tried net use T: \\server\directory in my bat
file, but the scheduler still cannot recognise drive T.

Thanks in advance,
Leo
 
R

Ray at

Use the UNC path in your batch. You will have permissions problems however,
since the local system account will not have permissions to access that
share, by default. You can change the AT service account to run under a
domain account.

Ray at work
 
J

Jerold Schulman

Hi,

I have a .bat program that renames some files on a mapped
directory. The problem I face is that when the program
runs on the AT scheduler, it does recognise the drive T or
any mapped drive. How can I get the scheduler to know what
drive T is?
Note, I tried net use T: \\server\directory in my bat
file, but the scheduler still cannot recognise drive T.

Thanks in advance,
Leo

The scheduler runs in the System context and has NO network access,

You could use psexec, tip 4141 in the 'Tips & Tricks' at http://www.jsiinc.com,
to run your batch file from the AT command.


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
G

Garry Deane

Hi,

I have a .bat program that renames some files on a mapped
directory. The problem I face is that when the program
runs on the AT scheduler, it does recognise the drive T or
any mapped drive. How can I get the scheduler to know what
drive T is?
Note, I tried net use T: \\server\directory in my bat
file, but the scheduler still cannot recognise drive T.

See NET USE /? and add a suitable username and password which has the
required privileges. If there's a security problem with placing a
password in your batch file, do as Ray has advised and change the
Schedule service to run under an authorised account.

Garry
 
C

Clay Calvert

The scheduler runs in the System context and has NO network access,

That isn't necessarily true. It is easy to change the account that AT
jobs run under. When using the schedule service the default account
can be changed in Services. The Task Scheduler default AT account can
be changed under the Advanced menu item when in the Scheduled Task
GUI.
You could use psexec, tip 4141 in the 'Tips & Tricks' at http://www.jsiinc.com,
to run your batch file from the AT command.

If you do this then passwords will be sent in the clear. An
acceptable risk for some but it is worth mentioning.

Clay Calvert
(e-mail address removed)
Replace "W" with "L"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top