win2k sp3: access mapped drive from service

  • Thread starter Thread starter d_dave
  • Start date Start date
D

d_dave

im having trouble accessing a mapped drive from an AutoExNT Service.
all the autoexnt.bat file contains is a command to create a folder on
the mapped drive:

md t:\\test

i can double-click the autoexnt.bat file and the folder is created.
but when i start the service, the folder never gets created. the t:
drive is already mapped.

any ideas?
 
im having trouble accessing a mapped drive from an AutoExNT Service.
all the autoexnt.bat file contains is a command to create a folder on
the mapped drive:

md t:\\test

i can double-click the autoexnt.bat file and the folder is created.
but when i start the service, the folder never gets created. the t:
drive is already mapped.

any ideas?

I suspect that the AutoExNT service runs under the System
account, which has no access to networked resources. Why
don't you use the Task Scheduler instead? It gives you the
option of running the task under any account you care to specify.
 
Is there a way to associate the serivce to a privleged user with
appropriate network access?
 
Is there a way to associate the serivce to a privleged user with
appropriate network access?

Yes - if you use the Task Scheduler! It is by far the
simplest way to get around your problem.

Perhaps services.msc lets you do the same thing. I've never tried.
 
ok it worked with Windows 2000 server sp3. Unfortunately, when I
installed Windows XP Pro sp2 and tried to keep the drive mapped all-
the-time, the mapped drive would disconnect when i log off and
reconnect when i log in. I want it mapped all the time even if I'm
logged off and when others are logged in.

Here is my mapping script:

set DRIVE_LETTER=X:
set SERVER=192.27.176.253
set SHARE=\\%SERVER%\share$

if NOT EXIST "%DRIVE_LETTER%" (
if NOT EXIST "%SHARE%" (
"C:\Program Files\Windows Resource Kits\Tools\sleep.exe" 75
)

echo %DATE% %TIME% > C:\autoexnt.log
net use %DRIVE_LETTER% %SHARE% /USER:administrator /PERSISTENT:YES
2>> C:\autoexnt.log
echo %ERRORLEVEL% >> C:\autoexnt.log
)
 
Back
Top