hi,
how do I make the CMD work when the program requires parameters?
this works:
Code:
CMD := "C:\Program Files\Wireshark\tshark.exe"
but as soon as I add parameters it won't work. I don't get any output so I guess the program won't be executed/found:
Quote:
CMD := "C:\Program Files\Wireshark\tshark.exe port 6112 -T fields -e data"
how do I get it work with parameters??
of course it has to be:
Quote:
"C:\Program Files\Wireshark\tshark.exe" port 6112 -T fields -e data
, in quotes, but since the CMD := "" already needs those two "" it doenst work!! and I can't find a syntax descriptiin in the autohotkey documentation.... in most languages \" would work but in ahk it doesnt!!

here is the complety code:
Code:
;// Consts
WINDOW_TITLE = Tomcat Console
;// GUI
Menu, Tray, NoStandard
Menu, Tray, Add, Exit, GuiClose
Gui, Add, Edit, x6 y10 w790 h790 +HScroll HWNDoutputh
Gui, Show, center h800 w800, %WINDOW_TITLE%
WinWait, %WINDOW_TITLE%
;// Create CMD
CMD := "C:\Program Files\Wireshark\tshark.exe port 6112 -T fields -e data"
;// Make thread
CBA_PIPE := RegisterCallback( "pipeThread" ) ;// pipeThread is the function to run in a separate thread
threadID := DllCall( "CreateThread", UInt,0, UInt,0, UInt,CBA_PIPE, UInt,0, UInt,0, UInt,0 )
;// Loop
Return
;// Quit
GuiClose:
;// Kill the stuff
Process, Close, "cmd.exe", ;// not sure this works but whatever
;// Kill thread
DllCall( "TerminateThread", UInt, threadID, UInt, 0 )
DllCall( "CloseHandle", UInt, threadID )
ExitApp, 0
;/**
; * Thread that writes to text area.
; */
pipeThread() {
global cmd, outputh
rc := DllCall("cmdret.dll\RunInControl", "str", CMD, "Uint", outputh) ;// outputh is the handler to the text area
}