Search code examples
batch-filetaskkill

Is taskkill safe to close a process?


I want to be able to close a process on a remote computer using a .bat file. eg: taskkill /im Myapp.exe

Is using taskkill a suitable way to close an application? eg like clicking the 'X' on the toolbar?

Does it give the app time to run all of it's closing down methods/destructors? Or does it cause it to end abruptly, losing any data that hasn't had a chance to be written before closing?


Solution

  • Yes, if you dont use /f.