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.
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- How to Debug/Register a Permanent WMI Event Which
- How can I do variable substitution in a here-strin
- Is TWebBrowser dependant on IE version?
- How to use a default value with parameter sets in
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- C#调用PowerShell的问题
- EscapeDataString having differing behaviour betwee
- IE/Edge not applying transform: translate to table
- Number of Javascript lines executed during page lo
-
Is it bad to put elements within the <hea
- PowerShell Change owner of files and folders
- Command line escaping single quote for PowerShell
查看全部
Try this:
get-process iexplore | stop-process
.This will loop around and call CloseMainWindow on all its windows, that is the graceful shutdown api call - it sleeps half a second to give it time to close each before going around:
powershell -Command "while ($true){Try{$process=Get-Process iexplore -ErrorAction Stop}Catch [Microsoft.PowerShell.Commands.ProcessCommandException]{break;}if ($process) {$whateva=$process.CloseMainWindow()}else {break;}Start-Sleep -m 500}"
Try the CloseMainWindow method: Closes a process that has a user interface by sending a close message to its main window.