Home All Groups Group Topic Archive Search About

accessing network drive at startup

Author
27 Feb 2007 9:22 PM
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%

Author
27 Feb 2007 11:54 PM
d_dave
On Feb 27, 1:22 pm, d_d***@my-deja.com wrote:
Show quoteHide quote
> 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".
Author
28 Feb 2007 12:59 AM
Jim
<d_d***@my-deja.com> wrote in message
Show quoteHide quote
news:1172620492.480548.290360@m58g2000cwm.googlegroups.com...
> On Feb 27, 1:22 pm, d_d***@my-deja.com wrote:
>> 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".
>
>
>
>
>
>
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
Author
28 Feb 2007 1:31 AM
d_dave
So how do i start my network before starting my scheduled task?
Author
28 Feb 2007 2:14 AM
Michael W. Ryder
d_d***@my-deja.com wrote:
> 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.
Author
28 Feb 2007 2:45 AM
d_dave
On Feb 27, 6:14 pm, "Michael W. Ryder" <_mwry***@worldnet.att.net>
wrote:
> d_d***@my-deja.com wrote:
> > 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.

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.
Author
28 Feb 2007 7:44 AM
Ian
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.
Author
28 Feb 2007 6:05 PM
d_dave
ok. placing a sleep 60 statement at the beginning of the bat script
allowed enough time for the network to come up.

'sleep' is available on the windows 2003 resource kit which works for
xp:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en

thanks to everyone who contributed to this thread. i hope it helps
others in the future.