Sign in to follow this  
Followers 0
weszzer

Wait to complete the process before sending a command (to cmd window)

7 posts in this topic

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}")

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites



Or simply use RunWait, instead of the command line:

RunWait("c:\extract_data.exe " & @YEAR &"/" & @MON & "/" & @MDAY)
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by weszzer

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks guys, I used to PID process wait the process to exit the program .exe then exit..

Share this post


Link to post
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
Sign in to follow this  
Followers 0