Neoborn Posted March 14, 2005 Share Posted March 14, 2005 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. 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 More sharing options...
Flashz Posted March 14, 2005 Share Posted March 14, 2005 I have written a very small program that basically just:1. launches another setup file, waits until it is installed then2. 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 then5. 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. Please someone help me complete this Thanks.<{POST_SNAPBACK}>TryRunWait(@ComSpec & " /c " & @ProgramFilesDir & "\Tivoli\reinstall.bat") Link to comment Share on other sites More sharing options...
Neoborn Posted March 14, 2005 Author Share Posted March 14, 2005 (edited) TryRunWait(@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 March 14, 2005 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 More sharing options...
MHz Posted March 14, 2005 Share Posted March 14, 2005 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 More sharing options...
SlimShady Posted March 14, 2005 Share Posted March 14, 2005 You need quotes, y'know, if you use a path with spaces. RunWait(@ComSpec & ' /c "' & @ProgramFilesDir & '\Tivoli\reinstall.bat"') Link to comment Share on other sites More sharing options...
Blue_Drache Posted March 14, 2005 Share Posted March 14, 2005 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 More sharing options...
Neoborn Posted March 14, 2005 Author Share Posted March 14, 2005 (edited) 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 March 14, 2005 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 More sharing options...
CyberSlug Posted March 14, 2005 Share Posted March 14, 2005 I wonder if you need to set the working directory? RunWait(@ComSpec & ' /c "' & @ProgramFilesDir & '\Tivoli\reinstall.bat"', @ProgramFilesDir & '\Tivoli", @SW_HIDE) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Neoborn Posted March 14, 2005 Author Share Posted March 14, 2005 (edited) 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 *Edit* Now this did it 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 March 15, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now