change order of program startup so batch file executes after wireless lan utility

hi there,

i need to execute a batch file to map a network drive but although it executes fine, it executes prior to the wireless LAN utility, therefore not mapping the drive.

is it possible to change the execution order so that either the batch file runs after the wireless LAN utility or can i make the batch file wait until the utility has executed?

thankyou
compmechanicAsked:
Who is Participating?
 
KarldasTierConnect With a Mentor Commented:
You could also try to launch both applications (WLAN Utility and mapping command) from the same batch file.

A nice command line utility for that is "start" - and it is included in Windows 2000/XP.

Your batchfile could look like the following

start /wait WLAN.exe
net use z: \\server\share

Written in that order, your batchfile will first start the WLAN Utility, wait until it is loaded and then continue with your mapping command. Of course you should then remove the WLAN-Utility from the startup-Folder / registry (HKLM/HKCU - SOFTWARE - Microsoft - Windows - Current Version - Run) to prevent double execution.

Hope that helped!

KarldasTier
0
 
compmechanicAuthor Commented:
another idea,

can i get the batch file to run the wireless LAN utility, then run the net use command to map the network drive?
0
 
compmechanicAuthor Commented:
i should have mentioned this, but i am using windows xp pro. does my batch file need to have the suffix .bat or .cmd?
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
tosh9iiiCommented:
Go to this webpage and download X-setup, it's like a super duper version of Tweak UI.

http://www.majorgeeks.com/download4083.html

After installation, go to Startup/Shutdown>Startup>Windows NT/XP/2K>AutoRun Part I>Move AutoRun Items.
Ignore the warning message.

Make the changes from there, assuming that the batch file is listed...

I tried searching the net for software that would allow you to change the order of the startup programs, but none of that software is free.

But I'll keep on searching and keep you updated.
0
 
KarldasTierCommented:
P.S: You need to specify the full path and filename of your WLAN-Utility in the start-command.
0
 
KarldasTierCommented:
P.P.S: Your batchfile should have the suffix .bat
0
 
AshuraKnightCommented:
gd advice karldastier :)
0
 
timothyfryerCommented:
you could also put a shortcut to your batch file in the startup folder and it will likely execute last of all if I'm not mistaken
0
 
compmechanicAuthor Commented:
thanks for all your posts. i will give it a go when i sit at that network.

timothyfryer - thats how i have the batch file setup but it gets executed before the WLAN utility unfortunately so when it goes to map the drive it can't.

but thanks all again, and ill report back.
0
 
timothyfryerCommented:
I would go into the registry then and find the wlan in the run keys if that is where is launching from and try putting the entry for the batch file shortcut after it.  I'm probably wrong again but I think the applications in the run key are executed in the same order as they exist in the registry key.
0
 
KarldasTierCommented:
Or use the start command and safe yourself the registry fiddling ;)

Plus you can be never really sure about the run order of registry calls. Depending on the time it takes to launch these programs, it can well be that the first call finishes loading last.


KarldasTier
0
 
timothyfryerCommented:
I guess I don't know how the wlan utility you were referring to is setup to load, but if it's loaded as a startup application then I think your right that you could run it from the same batch file as the mapping utility with a wait command following the wlan entry so that it completes before proceeding to map the drive    /wait     or something like that is the command line switch to force an app to complete before the batch continues
0
 
Luniz2k1Commented:
You could use the SLEEP.EXE from the resource kit and add it to the beginning of the batch file to make it wait for a number of seconds that you specify to give the wireless time to start.
0
 
compmechanicAuthor Commented:
KarldasTier - sorry but what do you mean start command?

my batch file is continuously running before the WLAN. can i put a time delay in the batch file, say 30 secs or something? will that then (provided of course that WLAN utility has executed and connected) make the batch execute its commands after the WLAN utility?
0
 
Luniz2k1Commented:
>>my batch file is continuously running before the WLAN. can i put a time delay in the batch file, say 30 secs or something? will that then (provided of course that WLAN utility has executed and connected) make the batch execute its commands after the WLAN utility?

See previous post.
0
 
KarldasTierCommented:
compmechanic: open a Dos Box on your Windows 2000 / XP machine and then type "help start" (without the "s). This should show you what "start" is all about.

Yes - it is a command line command, nothing graphical about it. But it works very well - at least for me ;)
0
 
Ron MalmsteadInformation Services ManagerCommented:
Use the batch file to call the wireless utility and map drives ...this way it won't map drives until the utility has started >

start "c:\program files\utility.exe"
cls
@echo off
echo ************************************
echo *      Wireless started !  *
echo *                             *
echo ************************************
net use f: "\\yourserver\f" /y
0
 
timothyfryerCommented:
Well, I thought that /wait was the appropriate command for "wait until programs finishes"
Turns out that command works with Microsoft Office but not sure if with anything else.  If it does, it would follow the first program line separated by a space, I think, so from xuserx2000 code above, which looks ok to me, it would be
start "c:\program files\utility.exe" /wait

If that doesn't work, then try putting the quotes around "program files" instead of the whole path string because any path with a space in it is likely to fail without quotes delineating the string somehow

This is the OFFICIAL Microsoft XP and 2003 Server Command Line A-Z Reference
http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/ntcmds.asp

This is the OFFICIAL Microsoft XP and 2003 Server Command  'Waitfor'
http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/waitfor.asp

I was going to write a batch file using the Waitfor command, but, once again, Microsoft
has figured out a way to explain it such that it is totally incomprehensible to me.  I've about decided that either everyone at Microsoft is a genius and I'm an imbecile, or, no one at Microsoft speaks English.  Either way, if you figure out how to express the program path name that the batch is supposed to 'Waitfor', and combine it with xuserx2000 code above,  I think you'll have it.





0
 
asafganotCommented:
Does your WLAN utility causes the computer to get an IP address?
If so, you could run a batch file through the IconZone utility - www.ganotools.net
This freeware enables you to run a script each time your IP configuration changes.
0
 
compmechanicAuthor Commented:
asafganot  > no, my machines have a static IP address i have assigned them

thanks for the posts everyone. i will try out the new approaches when i am infront of the machines and let you know how it goes.

i really appreciate the ideas and effort
0
All Courses

From novice to tech pro — start learning today.