Gameday 0 Posted May 18, 2011 I had a problem yesterday with some of the commands sent to a cmd.exe turning up differently ( ). It turned out to be kind of a race condition. I was doing a WinActivate and then immediately going for the send. Somehow, when I sent something like dir && ls to cmd.exe, it got there as dir 77 ls. I added a Sleep after the WinActivate and the Send, and everything turned out ok. How long does it usualy take for WinActivate, to activate? Is it posting a message, and everything happens later? Is there another function I could call, that would happen immediately? I'd like to make sure that my window is really active when I'm trying to send. Share this post Link to post Share on other sites
Warmonger 0 Posted May 18, 2011 (edited) I had a problem yesterday with some of the commands sent to a cmd.exe turning up differently ( ). It turned out to be kind of a race condition. I was doing a WinActivate and then immediately going for the send. Somehow, when I sent something like dir && ls to cmd.exe, it got there as dir 77 ls. I added a Sleep after the WinActivate and the Send, and everything turned out ok.How long does it usualy take for WinActivate, to activate? Is it posting a message, and everything happens later? Is there another function I could call, that would happen immediately? I'd like to make sure that my window is really active when I'm trying to send.Look at WinWaitActive in the help file. Edited May 18, 2011 by Warmonger [AutoIt File Patcher] Share this post Link to post Share on other sites
Gameday 0 Posted May 18, 2011 Hi WarMonger! I know of the WinWaitActive, but the following combination didn't seem to work yesterday: WinActivate("My Window") WinWaitActive("My Window") After I called WinWaitActive, the only way my code continued was if I made it active by clicking on it. My AutoIt script is running on a remote computer, automating part of a build process , and I will not be able to activate it manually. Share this post Link to post Share on other sites