gravity-1
April 17th, 2005, 10:45 AM
Hi all,
I have a simple little problem with CreateProcess(). I've been searcing msdn and forums and haven't found the solution yet but I'm sure it's a simple one.
I want to execute this console command:
tethereal -a duration:300 -f "ip proto 1" -n >"c:\\program files\\blah\\blah.txt"
I'm using CreateProcess and I have this call:
CreateProcess("c:\\program files\\ethereal\\tethereal.exe",
" -a duration:300 -f \"ip proto 1\" -n >\"c:\\program files\\blah\\blah.txt\"",
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi))
I figured this would work but it just opens the program and closes it immediately. The '-a duration:300' is supposed to make it run for exactly 300 seconds. I know the lpApplicationName parameter is working because if I set lpCommandLine to NULL it runs until I close it. So the problem is with the lpCommandLine parameter.
I don't know if some of the special characters in that string are causing the problem or what.
If anyone knows what the problem is please enlighten me.
Thanks a lot,
grav
I have a simple little problem with CreateProcess(). I've been searcing msdn and forums and haven't found the solution yet but I'm sure it's a simple one.
I want to execute this console command:
tethereal -a duration:300 -f "ip proto 1" -n >"c:\\program files\\blah\\blah.txt"
I'm using CreateProcess and I have this call:
CreateProcess("c:\\program files\\ethereal\\tethereal.exe",
" -a duration:300 -f \"ip proto 1\" -n >\"c:\\program files\\blah\\blah.txt\"",
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&si,
&pi))
I figured this would work but it just opens the program and closes it immediately. The '-a duration:300' is supposed to make it run for exactly 300 seconds. I know the lpApplicationName parameter is working because if I set lpCommandLine to NULL it runs until I close it. So the problem is with the lpCommandLine parameter.
I don't know if some of the special characters in that string are causing the problem or what.
If anyone knows what the problem is please enlighten me.
Thanks a lot,
grav