Solved

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

Posted on 2004-08-04
21
412 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:compmechanic
  • 5
  • 5
  • 5
  • +5
21 Comments
 

Author Comment

by:compmechanic
ID: 11723305
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
 

Author Comment

by:compmechanic
ID: 11723340
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
 
LVL 9

Expert Comment

by:tosh9iii
ID: 11723641
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
KarldasTier earned 50 total points
ID: 11724607
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
 
LVL 1

Expert Comment

by:KarldasTier
ID: 11724616
P.S: You need to specify the full path and filename of your WLAN-Utility in the start-command.
0
 
LVL 1

Expert Comment

by:KarldasTier
ID: 11725106
P.P.S: Your batchfile should have the suffix .bat
0
 
LVL 5

Expert Comment

by:AshuraKnight
ID: 11725691
gd advice karldastier :)
0
 
LVL 10

Expert Comment

by:timothyfryer
ID: 11725720
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
 

Author Comment

by:compmechanic
ID: 11725922
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
 
LVL 10

Expert Comment

by:timothyfryer
ID: 11726001
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
 
LVL 1

Expert Comment

by:KarldasTier
ID: 11726456
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
 
LVL 10

Expert Comment

by:timothyfryer
ID: 11726523
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
 
LVL 5

Expert Comment

by:Luniz2k1
ID: 11726558
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
 

Author Comment

by:compmechanic
ID: 11726570
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
 
LVL 5

Expert Comment

by:Luniz2k1
ID: 11727048
>>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
 
LVL 10

Expert Comment

by:timothyfryer
ID: 11727113
0
 
LVL 1

Expert Comment

by:KarldasTier
ID: 11727274
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
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 11730473
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
 
LVL 10

Expert Comment

by:timothyfryer
ID: 11730913
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
 
LVL 1

Expert Comment

by:asafganot
ID: 11739823
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
 

Author Comment

by:compmechanic
ID: 11745099
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question