I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP.
Process suspend/resume tool does it with SuspendThread
/ ResumeThread
but warns about multi-threaded programs and deadlock problems.
PsSuspend looks okay, but I wonder if it does anything special about deadlocks or uses another method?
Prefered languages : C++ / Python
All you have to do is find the PID (Process ID) and using ps or ps aux command, and then pause it, finally resume it using kill command. Here, & symbol will move the running task (i.e. wget ) to the background without closing it.
- Click Start and type resmon. - Select the first result, resmon. Here you should see a list of running processes, and when you right-click them it'll give you the option to suspend and resume.
Execution of a batch script can also be paused by pressing CTRL-S (or the Pause|Break key) on the keyboard, this also works for pausing a single command such as a long DIR /s listing. Pressing any key will resume the operation.
You can pause execution of a process by sending it a SIGSTOP signal and then later resume it by sending it a SIGCONT .
I'm not sure if this does the job, but with ProcessExplorer from MS Systernals you can suspend a process.
It's been said here: https://superuser.com/a/155263 and I found it there too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With