Windows – ny way to start process in suspended state?

debuggingwindowswindows-xp

I want to launch a process in suspended state. Is there any way to do this by using only standard tools coming with Windows XP? Is there any lightweight third party tools?

Problem I'm trying to solve:
I have a application which I want to debug it by using Visual Studio 2005. I have debug build with necessary *.pdb files and I have all sources referenced from these *.pdb files. I don't want to create an empty solution which will run that application for me, so I'm trying to attach to this process after it's launched from other place. Some part of code I want to debug is executed at the beginning of process start-up, so I want to run it in suspended mode, attach a debugger and then resume it.

Best Solution

I'm not exactly sure what you're trying to do from your question, but maybe using the ntsd debugger which comes with XP will help you do what you want (by default, ntsd will load the process and stop at the first instruction).


From the updated information in your question, I'd suggest downloading the Debugging Tools for Windows package from Microsoft and debugging the startup stuff in WinDbg -the are some things that Visual Studio is better at, but there are also some things that WinDbg is better at than Visual Studio (WinDBg is a very powerful debugger).

Or you can simply load the program in the Visual Studio debugger (without a solution) from the command line:

devenv /debugexe yourprog.exe <arguments>