Tôi muốn đóng trình duyệt internet sạch/duyên dáng. Một taskkill sẽ đóng nó nhưng khi mở lại nó sẽ hỏi bạn có muốn mở lại phiên cuối cùng không.powershell close internet explorer gracefully/cleanly
5
A
Trả lời
7
Thử phương thức CloseMainWindow: Đóng một quy trình có giao diện người dùng bằng cách gửi thông báo gần đến cửa sổ chính của nó.
Get-Process iexplore | Foreach-Object { $_.CloseMainWindow() }
3
Hãy thử cách này: get-process iexplore | stop-process
.
0
Điều này sẽ lặp lại và gọi CloseMainWindow trên tất cả các cửa sổ của nó, đó là duyên dáng gọi tắt api - nó ngủ một nửa thứ hai để cho nó thời gian để đóng mỗi trước khi đi xung quanh:
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}"
Các vấn đề liên quan
- 1. cloneNode trong internet explorer
- 2. Internet Explorer 9 VHD
- 3. addEventListener trong Internet Explorer
- 4. setTimeout Internet Explorer
- 5. Flot và Internet Explorer 9?
- 6. Internet explorer font face ssl
- 7. Internet Explorer toDataURL() thay thế?
- 8. Màu nền trong Internet Explorer
- 9. Internet Explorer Nested Form Post
- 10. phím tắt Disable Internet Explorer
- 11. execCommand ("insertHTML", ...) trong Internet Explorer
- 12. Thực thi javascript máng Giao diện com của Internet Explorer bằng PowerShell
- 13. <blink> thẻ trong Internet Explorer
- 14. Internet Explorer 8 lỗi div trùng lặp
- 15. Tiêu đề xoay trên Internet explorer
- 16. Đăng-Chuyển hướng-Nhận với Internet Explorer
- 17. Mặt nạ CSS trong Internet Explorer 10
- 18. Tương tác VBA với internet explorer
- 19. Dừng WebBrowser khiến Internet Explorer được mở
- 20. Tối ưu hóa Javascript cho Internet Explorer
- 21. Nhúng điều khiển Internet Explorer - C++ WinAPI
- 22. Internet Explorer không hiển thị Flowplayer-Video
- 23. Hiển thị ảnh Internet Explorer và Base64
- 24. Ẩn Internet Explorer khi WatiN chạy
- 25. Cách kích hoạt script.onerror trong Internet Explorer?
- 26. Thảm họa tương thích Internet Explorer
- 27. Internet Explorer Thích nút điên cuồng
- 28. Sự cố với mousemove trong Internet Explorer
- 29. Internet Explorer xx.yy vấn đề trang web
- 30. Lỗi z-index của Internet Explorer?
Liệu này cũng đóng bất kỳ quá trình ẩn IExplore ẩn? –