I am trying to run this code:
Code:
sWindump = windump.exe -A -q -i 2 -p >>D:\bumblebee\windump.txt
Run, %comspec% /k
ControlSend,,%sWindump%`n,ahk_Class ConsoleWindowClass
sleep, 3000
ControlSend,,^c,ahk_Class ConsoleWindowClass
What is supposed to happen is the windump program starts, and i need to close it later using a CTRL-C command. If windump is not closed with CTRL-C it does not output what it's seen (packets).
If I start windump manually outside autohotkey it works fine. And I can send the CTRL-C using autohotkey controlsend and kill it clean.
If I start windump using the autohotkey comspec command, after the windump command executes the cmd window is "frozen" and won't accept anymore controlsends. I can't figure out why. Even if I manually press CTRL-C at the cmd window started by autohotkey, it is frozen. It only freezes after the windump line starts. I'm guessing something in comspec is not right. Maybe a switch I need, or quotes.