accessing network drive at startup

D

d_dave

Hi, I just build a winXP server that will function as my license
server at work running lmgrd from a mapped drive. Previously, when
running win2k server, I was able to create a local bat script and
setup a scheduled task to launch this bat script that will in turn
access the mapped drive with the application and licenses. This worked
fine until i switched over to Windows XP. Now my script fails to
access the mapped drive at startup. And when I manually run the
scheduled task, it will start but stop when I log off.

So my question... Is there anyway for me to access a mapped drive in
XP at startup and run an application in the background.

Here is my bat script:

set DRIVE_LETTER=T:

echo %DATE% %TIME% > C:\autoexnt.log
net use %DRIVE_LETTER% \\192.27.176.253\license /USER:administrator /
PERSISTENT:YES 2>> C:\autoexnt.log
echo %ERRORLEVEL% >> C:\autoexnt.log

set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set yymmdd_hhmmss=%date:~10,4%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%
%time:~6,2%

set HOSTNAME=%COMPUTERNAME%
set LICENSE=Ansys
set LOG_NAME=%yymmdd_hhmmss%_%HOSTNAME%.log

for %%i in (%LICENSE%) do %DRIVE_LETTER%\%%i\bin\lmgrd.exe -local -c
%DRIVE_LETTER%\%%i\license\license.dat -l %DRIVE_LETTER%\%%i\log\%%i-
%LOG_NAME%
 
D

d_dave

Hi, I just build a winXP server that will function as my license
server at work running lmgrd from a mapped drive. Previously, when
running win2k server, I was able to create a local bat script and
setup a scheduled task to launch this bat script that will in turn
access the mapped drive with the application and licenses. This worked
fine until i switched over to Windows XP. Now my script fails to
access the mapped drive at startup. And when I manually run the
scheduled task, it will start but stop when I log off.

So my question... Is there anyway for me to access a mapped drive in
XP at startup and run an application in the background.

Here is my bat script:

set DRIVE_LETTER=T:

echo %DATE% %TIME% > C:\autoexnt.log
net use %DRIVE_LETTER% \\192.27.176.253\license /USER:administrator /
PERSISTENT:YES 2>> C:\autoexnt.log
echo %ERRORLEVEL% >> C:\autoexnt.log

set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set yymmdd_hhmmss=%date:~10,4%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%
%time:~6,2%

set HOSTNAME=%COMPUTERNAME%
set LICENSE=Ansys
set LOG_NAME=%yymmdd_hhmmss%_%HOSTNAME%.log

for %%i in (%LICENSE%) do %DRIVE_LETTER%\%%i\bin\lmgrd.exe -local -c
%DRIVE_LETTER%\%%i\license\license.dat -l %DRIVE_LETTER%\%%i\log\%%i-
%LOG_NAME%


Here is more info. The system is running Windows XP Pro SP2 and all
the necessary services are started. I can use the net use command
after boot up to map the drive just fine. But when the task is
scheduled to start at startup in the bat script, the net use command
returns an error 67: "System error 67 has occurred. The network name
cannot be found".
 
J

Jim

Here is more info. The system is running Windows XP Pro SP2 and all
the necessary services are started. I can use the net use command
after boot up to map the drive just fine. But when the task is
scheduled to start at startup in the bat script, the net use command
returns an error 67: "System error 67 has occurred. The network name
cannot be found".
That message means that the network has not been started at the time that
your batch file executed.
With no network, the mapping cannot take place.
Jim
 
M

Michael W. Ryder

So how do i start my network before starting my scheduled task?

Have you tried using the Scheduled Tasks program? One of the options is
to run the program once the computer starts or when the user logs in.
The delay may be enough for the network to have started before it is run.
 
D

d_dave

Have you tried using the Scheduled Tasks program? One of the options is
to run the program once the computer starts or when the user logs in.
The delay may be enough for the network to have started before it is run.

I need the task to start immediately upon boot up. this is a license
server, not a desktop. there will be no one logging into the machine.

one thing i will try is to use the 'sleep' command that's provided in
the windows resource kit. hopefully that'll stall launch of the app
enough so that network services are started.
 
G

Guest

I take it you know how to set autologon, and are using that?

AutoIt suggests itself for scripting the program start. This way you can:

Ping the machine to ensure the network's up.
Map the drive.
Test the connection, and repeat if mapping wasn't successful.
Sleep for a number of milliseconds.
Run the program.

http://www.autoitscript.com

You could also do this with KixStart, though I prefer AutoIt.
 

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