Closing the cmd.exe process RRS feed

  • Question

  • How do I programmatically kill a console/cmd.exe process? 

    I used the CreateToolhelp32Snapshot function to create a list of all running processes, and then used Process32First and Process32Next to iterate over the list. Unfortunately while a cmd.exe is running it is not in the list. I need to it be closed, or at least, not to be visible.

    I installed third party software to monitor all processes on the ce device. This software couldn't detect the cmd.exe process either. 

    A possible workaround could be to use the createprocess function to start an exe file with output redirected to something other than a console. This way, the cmd.exe will never be run in the first place as it's actually loaded by another program (by way of standard output, so we assume) that my program starts with createprocess.

    The cmd.exe program's name is 'pocket cmd'.

    Saturday, May 4, 2013 7:10 PM

All replies