Jump to content

Not Working On Bat Wait


Recommended Posts

I have written a very small program that basically just:

1. launches another setup file, waits until it is installed then

2. Launches a .bat file that reinstalls the client (remote tool)

I have gotten up to the batch file successfully but am confused as how to proceed in the syntax.

The batch file opens but closes immediately. What I need to do is:

3. Use the @programfilesdir macro in case people have their program files directories on other drives than C:\

4. Launch the bat file and wait until it is done then

5. Wait until processes are running before program quits.

The code line I am having trouble with is:

RunWait(@ProgramFilesDir & "\Tivoli\reinstall.bat")

This runs the files but quits instantly before it is finished. :D Please someone help me complete this :)

Thanks.

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

I have written a very small program that basically just:

1.  launches another setup file, waits until it is installed then

2. Launches a .bat file that reinstalls the client (remote tool)

I have gotten up to the batch file successfully but am confused as how to proceed in the syntax.

The batch file opens but closes immediately. What I need to do is:

3. Use the @programfilesdir macro in case people have their program files directories on other drives than C:\

4. Launch the bat file and wait until it is done then

5. Wait until processes are running before program quits.

The code line I am having trouble with is:

RunWait(@ProgramFilesDir & "\Tivoli\reinstall.bat")

This runs the files but quits instantly before it is finished. :D Please someone help me complete this :)

Thanks.

<{POST_SNAPBACK}>

Try

RunWait(@ComSpec & " /c " & @ProgramFilesDir & "\Tivoli\reinstall.bat")

Link to comment
Share on other sites

Try

RunWait(@ComSpec & " /c " & @ProgramFilesDir & "\Tivoli\reinstall.bat")

<{POST_SNAPBACK}>

Thank you for your reply I will try that. What does the /c do?

*Edit* Nope command screen / dos screen still just flashes on screen instead of staying until the program is complete(reinstall.bat)

Edited by Neoborn

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

Thank you for your reply I will try that. What does the /c do?

Start a command box, and type cmd /?

It will tell you that the switch, /c, closes the command box, when the commands are finished.

*Edit* Nope command screen / dos screen still just flashes on screen instead of staying until the program is complete(reinstall.bat)

Are you using START /WAIT in you batch file, for starting these programs?

:)

Link to comment
Share on other sites

You need quotes, y'know, if you use a path with spaces.

RunWait(@ComSpec & ' /c "' & @ProgramFilesDir & '\Tivoli\reinstall.bat"')

<{POST_SNAPBACK}>

And don't forget the @SW_HIDE if you don't want to see the dosbox flash.

RunWait(@ComSpec & ' /c "' & @ProgramFilesDir & '\Tivoli\reinstall.bat"',"",@SW_HIDE)

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

I tried your suggestions yet it still just flashes. I believe this to be related to the script because if I click on the reinstall.bat in the folder it works fine but does not from the AutoIT script.

Edited by Neoborn

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

try...

RunWait(@comspec & " /c start /wait reinstall.bat",@ProgramFilesDir & "\Tivoli")

lar.

<{POST_SNAPBACK}>

Nice Larry! now I have it working with

RunWait(@comspec & " /c start reinstall.bat",@ProgramFilesDir & "\Tivoli")

This now does the real deal but doesn't close the window :D

*Edit* Now this did it :D Yippppeeeee@!!!

RunWait(@comspec & " /c reinstall.bat",@ProgramFilesDir & "\Tivoli")

Program works sweet now.

Anyone want to chat to me on how the progress bar works ( :) step me through the code)?

Edited by Neoborn

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...