I would like to close internet explorer cleanly/ gracefully. A taskkill would close it but when re-opening it it will ask if you want to re-open the last session.
Open Start. Search for PowerShell, right-click the top result, and select the Run as administrator option. Type the following command to disable Internet Explorer 11 and press Enter: Disable-WindowsOptionalFeature -FeatureName Internet-Explorer-Optional-amd64 –Online.
Kill a process with Taskkill Taskkill allows you to kill a process either by its PID or by the name listed for it in the tasklist output. To stop a process by its ID, use taskkill /F /PID <PID> , such as taskkill /F /ID 312 7 if 3127 is the PID of the process that you want to kill.
Killing a process with TASKKILL At the basic level, TASKKILL is like clicking the X button on the top-right corner of any Windows application. It will “gracefully” exit the program and will prompt you “whether to save changes” before exiting.
Try the CloseMainWindow method: Closes a process that has a user interface by sending a close message to its main window.
Get-Process iexplore | Foreach-Object { $_.CloseMainWindow() }
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