Solved

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

Posted on 2004-08-04
21
388 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 1

Accepted Solution

by:
KarldasTier earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
P.P.S: Your batchfile should have the suffix .bat
0
 
LVL 5

Expert Comment

by:AshuraKnight
Comment Utility
gd advice karldastier :)
0
 
LVL 10

Expert Comment

by:timothyfryer
Comment Utility
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
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Expert Comment

by:KarldasTier
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
0
 
LVL 1

Expert Comment

by:KarldasTier
Comment Utility
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 M
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Clickfree HD 6 87
Windows 10 PRo Upgrade 21 61
Changing the installation path of this MSI 5 85
Changing names of Physical Servers 1 27
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 …
I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now