Tuna 0 Posted October 3, 2010 I was given a script but can't get it to run. Could someone break it down so I can figure out why it doesn't run for me? Thanks for any help the lines with the < preceding them do not have that symbol, they have the gray box and bar so I guess they are rem statements? <#Region ;**** Directives created by AutoIt3Wrapper_GUI **** <#AutoIt3Wrapper_outfile=One that is scheduled\Evony.exe <#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Dim $PID = 0 $PID = ProcessExists("iexplore.exe") ; Will return the PID or 0 if the process isn't found. <Do < ProcessClose($PID) < $PID = ProcessExists("iexplore.exe") Until $PID = 0 Run ("C:\Program Files (x86)\Internet Explorer\iexplore.exe", @SW_MAXIMIZE) Share this post Link to post Share on other sites
JohnOne 1,603 Posted October 3, 2010 Its going to depend what isnt working ProcessExists() ProcessClose() Run() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Calistoga 0 Posted October 3, 2010 (edited) You forgot the correct second argument for Run(), which is "workingdir", not show_flag.Anyways, I revised your code a little and tried to comment everything properly. Ask if you got any questions #AutoIt3Wrapper_outfile=Evony.exe; This tells the compiler to name the finished exe "Evony.exe". Local $PID = ProcessExists("iexplore.exe"); Will return the PID or 0 if the process isn't found. While ($PID <> 0); This loop will keep going until $PID equals 0. If (ProcessClose($PID) <> 1) Then ContinueLoop; If ProcessClose() returns any other value that 1, it failed to close the process. $PID = ProcessExists("iexplore.exe"); If the process was found, $PID should now contain its handle (hWnd). WEnd; Now we loop up to "While" and check whether $PID is still not 0. Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE); Now we're going to run Internet Explorer. Exit; That's it. Edited October 3, 2010 by Encoded Share this post Link to post Share on other sites
Tuna 0 Posted October 3, 2010 Thanks alot. I got rid of the loop since it doesn't make sense to me. Why continue looking for a file? it's either there or it's not. and with your changes it worked fine. haven't done stuff like this since I played with basic in the 80's. gonna take awhile to get the hang of it Share this post Link to post Share on other sites
JohnOne 1,603 Posted October 3, 2010 Why continue looking for a file? it's either there or it's not.Your code suggested that their may be multiple instances of IE open, if that could be the case then you are going to need a loop of some sort. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Tuna 0 Posted October 9, 2010 That would explain the loop then. thanks. removing was best then because I want to open a new window when the script runs Share this post Link to post Share on other sites