![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-09 07:03 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » Restart "Windows Explorer" → VBS Version |
| Printable Version 1,445 / 10 |
| Floor1 baomaboy | Posted 2007-03-17 12:42 |
| 银牌会员 Posts 554 Credits 1,513 | |
|
Issued at the request of chengbiner, actually there are just two sentences:
To determine whether it is an Nt or 9x system, use respectively: ntsd -c q -pn Explorer.exe RUNDLL32 SHELL32.DLL,SHExitWindowsEx -1 It is mostly used to take effect immediately after modifying the registry, and for easy operation at any time, it is placed in the right-click menu of files and folders. Attachments Restare_Explorer.rar (5.12 KiB) 1.GIF (5.38 KiB) |
|
| Floor2 lxmxn | Posted 2007-03-17 13:23 |
| 版主 Posts 4,938 Credits 11,386 | |
|
The second command, I encountered an error in the command line support, saying that the entry "SHExitWindowsEx" is missing. What's going on? |
|
| Floor3 baomaboy | Posted 2007-03-17 13:27 |
| 银牌会员 Posts 554 Credits 1,513 | |
Originally posted by lxmxn at 2007-3-17 13:23: The second command is for WinMe, and the same kernel is estimated to be usable for 98 as well. It has been canceled in XP. The reason for writing this command is that the Win9x series does not support the first command ntsd (not tested, should be like that) [ Last edited by baomaboy on 2007-3-17 at 01:28 PM ] |
|
| Floor4 lxmxn | Posted 2007-03-17 13:32 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Oh, so that's how it is. Is there a similar command under XP?
|
|
| Floor5 baomaboy | Posted 2007-03-17 13:35 |
| 银牌会员 Posts 554 Credits 1,513 | |
|
I couldn't find relevant similar commands. The following can also be used under XP
For Each Process in GetObject("winmgmts:"). _ ExecQuery ("select * from Win32_Process where name='explorer.exe'") Process.terminate(0) Next |
|
| Floor6 lxmxn | Posted 2007-03-17 13:46 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Well, this VBS for ending processes is good. The following commands can all achieve the effect of ending the explorer.exe process: 1、Wmic process where "name='explorer.exe'" call terminate 2、Taskkill /f /im explorer.exe 3、Ntsk -c q -pn explorer.exe 4、Stop-Process -name explorer (used under Windows PowerShell) |
|
| Floor7 baomaboy | Posted 2007-03-17 14:04 |
| 银牌会员 Posts 554 Credits 1,513 | |
Originally posted by lxmxn at 2007-3-17 13:46: There are many, bookmarked for later use. Brother, have you ever encountered a situation where after ending it, explorer.exe cannot be recreated? Only an empty desktop remains, and you have to manually run it in the Task Manager. I don't know if it's because my system is unstable or something else? Since I don't know the reason, there's no proper solution. I can only add in the code to end the explorer.exe process, wait for 3 seconds, then check if explorer.exe process exists; if it does, exit; if not, recreate it. The original code didn't add a delay before recreating explorer.exe. Later, I don't know if the system became stable or something else, but every time an extra explorer.exe window would open up ^_^ [ Last edited by baomaboy on 2007-3-17 at 02:15 PM ] |
|
| Floor8 baomaboy | Posted 2007-04-13 14:05 |
| 银牌会员 Posts 554 Credits 1,513 | |
Dim WshSHell,FSO [ Last edited by baomaboy on 2008-3-25 at 01:02 AM ] |
|
| Floor9 eech | Posted 2008-07-21 17:57 |
| 高级用户 Posts 346 Credits 906 | |
|
If you can return to the original directory and call it by right-clicking on the desktop blank, it will be perfect
|
|
| Floor10 kidzgy | Posted 2008-07-23 22:04 |
| 中级用户 Posts 129 Credits 262 | |
Originally posted by baomaboy at 2007-3-17 02:04 PM: I have also encountered it, but it was under BAT. After I got the VBS from the moderator to start explorer, I didn't have that problem anymore. If start explorer.exe in the bat does have unstable factors, it should be an issue with CMD itself. Even if I added many start explorer.exe below, sometimes it wouldn't run. I think VBS is more stable. So far, I haven't had that unstable problem. The code to restart explorer.exe is: only two lines in the bat @taskkill /im explorer.exe /f >nul @mshta VBScript:CreateObject("WScript.Shell").Run("explorer.exe")(window.close) |
|
| Floor11 chengbiner | Posted 2008-07-24 03:40 |
| 初级用户 Posts 44 Credits 105 | |
|
Thanks to brother baomaboy. It's been a long time since I came here. I didn't expect to see my name again. Thanks to brother baomaboy once more.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |