weszzer Posted December 5, 2014 Share Posted December 5, 2014 My Autoit script is sending a command to extract a data as excel/csv file , the extracted file size is not less than 10mb it can be more than 300mb. After the file extracted there is no message or anything, is automatically goes to “ C: “ . But since the time to extract the date is not the same at all times, so the sleep command before I send (“exit”) then send ("[enter]") to exit from cmd window is not possible. Is there any command to detect if the cmd prompt is return to c: so I can send a exit command. Thank you. Send ("c:\extract_data.exe " & @YEAR &"/" & @MON & "/" & @MDAY) Sleep("2000") Send ("{Enter}") ;(wait until the file extracted then send and EXIT command to exit) send ("Exit") ; from c:\ - but extracting is completed? Send ("{Enter}") Link to comment Share on other sites More sharing options...
JohnOne Posted December 5, 2014 Share Posted December 5, 2014 How are you opening command prompt? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 5, 2014 Moderators Share Posted December 5, 2014 Or simply use RunWait, instead of the command line: RunWait("c:\extract_data.exe " & @YEAR &"/" & @MON & "/" & @MDAY) SorryButImaNewbie 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
weszzer Posted December 6, 2014 Author Share Posted December 6, 2014 How are you opening command prompt? Yes JohnOne, I'm using a command prompt to execute the command, then after the command completed it goes directly to c: _ or it prompt to c; without any message. Problem is before my sleep time/delay elapsed the process is not completed. Thank you for the response. Link to comment Share on other sites More sharing options...
weszzer Posted December 11, 2014 Author Share Posted December 11, 2014 (edited) I still can't figure out on how to exit to cmd-console after my file extracted. then adding a pop-up message saying "Data Extracted" #include <date.au3> Run("cmd.exe") Sleep(2000) Send ("C:\Extract.exe DATE= 20/08/2011") ;wait to complete the extraction then exit the command/dos console then a pop-up message saying "file extracted" After the file created the command automatically goes to "C:" it mean the process is completed, then I would like to exit the console then a pop-up message saying "Data Extracted" with the date from the last day or previous day. Need your help guys.. Thank you very much. Edited December 11, 2014 by weszzer Link to comment Share on other sites More sharing options...
kylomas Posted December 11, 2014 Share Posted December 11, 2014 Did you try Jlogan's suggestion from post #3? Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
weszzer Posted December 16, 2014 Author Share Posted December 16, 2014 Thanks guys, I used to PID process wait the process to exit the program .exe then exit.. 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