It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search.
Does anyone know how to gracefully stop a Windows process remotely on Windows XP Professional machines i. The pskill utility seems to only do forceful terminations, and the taskkill utility explicitly mentions in its usage message that "Termination of remote processes will always be done forcefully".
How about using the psexec command from SysInternals to initiate taskkill locally on the workstations? Since taskkill is technically executed locally, it should close the process gracefully. The right tool seems to be PsService from Sysinternals. Check it out Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. I want to terminate a number of processes, but I want to give each process the chance to save its data, ask the user about saving a file and even ignore the close request. So TerminateProcess is out of the question, because it kills the process instantly.
Is there any other way to find the main windows of a process? In other words: Is there any way to terminate any process gracefully just like the Windows 7 task manager did when you clicked on " End Task "?
EnumWindows enumerates all the top level windows in a process. User code is not allowed to call DestroyWindow from a different app or thread to the windows This will not close console applications as the application process, and process that owns the window, are different. Refer to T. Arun 's answer below for the correct method for dealing with console applications. I'm not too sure about the win32 apis but you could shell execute the taskkill command line function. To add to Chris Becke answer about terminating gracefully terminating console process.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to gracefully terminate a process?
Ask Question. Asked 12 years ago. Active 1 year, 9 months ago. Viewed 52k times. Improve this question. Daniel Rikowski. Daniel Rikowski Daniel Rikowski 68k 56 56 gold badges silver badges bronze badges. I assume that "Tasks" are top level visible windows. If you're not a software developer — just a Windows user — see the related Super User question on how to gracefully ask a running application to terminate. Title How to gracefully terminating a background process running on Windows?
Article Number Environment Product: OpenEdge Version: A listener program running in background uses sockets to listen on a server socket. The process doesn't have an interface to the user so the only way to stop the process is to kill it. Since the process runs in background there isn't a way to know where the processing is at any particular time when it's killed. So messages can be lost. How can the process be ended cleanly without killing it? Steps to Reproduce. Clarifying Information.
Error Message. Defect Number. Enhancement Number. Resolution There are several ways to gracefully terminate a background process. Possible solutions could be: Define a shutdown message that the background process responds to and shuts itself down gracefully.
0コメント