|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『楼 主』:
重启“资源管理器"之→VBS版
使用 LLM 解释/回答一下
应chengbiner要求而发,其实就两句话:
判断是Nt还是9x系统分别用:
ntsd -c q -pn Explorer.exe
RUNDLL32 SHELL32.DLL,SHExitWindowsEx -1
多用于修改注册表之后及时生效,
为了方便随时操作放在了文件和文件夹右键菜单中。
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.
附件
1: Restare_Explorer.rar (2007-3-17 12:42, 5.12 KiB,下载次数: 69)
附件
2: 1.GIF (2007-3-17 12:42, 5.38 KiB,下载次数: 3)
|
|
2007-3-17 12:42 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
第2个命令,我在命令行支持出错了,说是丢失条目“SHExitWindowsEx”,怎么回事?
The second command, I encountered an error in the command line support, saying that the entry "SHExitWindowsEx" is missing. What's going on?
|
|
2007-3-17 13:23 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
Originally posted by lxmxn at 2007-3-17 13:23:
第2个命令,我在命令行支持出错了,说是丢失条目“SHExitWindowsEx”,怎么回事?
第2个命令是用于WinMe的,同样内核估计98也可以用,xp中已取消了,
之所以写此命令是因为Win9x系列不支持第1个命令ntsd (没测试过,应该是吧)
Last edited by baomaboy on 2007-3-17 at 01:28 PM ]
Originally posted by lxmxn at 2007-3-17 13:23:
The second command, I got an error in the command line support, saying that the entry "SHExitWindowsEx" is missing. What's going on?
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 ]
|
|
2007-3-17 13:27 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
哦,原来如此。XP下有没有类似的命令呢?
Oh, so that's how it is. Is there a similar command under XP?
|
|
2007-3-17 13:32 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
没查到过相关的类似命令,下面这个xp下也可以
For Each Process in GetObject("winmgmts:"). _
ExecQuery ("select * from Win32_Process where name='explorer.exe'")
Process.terminate(0)
Next
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
|
|
2007-3-17 13:35 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
嗯,这个VBS的结束进程的不错。下面的命令都可以达到结束explorer.exe进程的效果:
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(Windows PowerShell下使用)
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)
|
|
2007-3-17 13:46 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by lxmxn at 2007-3-17 13:46:
嗯,这个VBS的结束进程的不错。下面的命令都可以达到结束explorer.exe进程的效果:
1、Wmic process where "name='explorer.exe'" call ...
好多啊,收藏备用了。
兄有遇到过结束后不能重建explorer.exe的情况吗?只留个空桌面,还得手动任务管理器运行,不知是否我的系统不稳定的原因还是其他?
由于不知原因所在所以没有正统的解决方法,只能在代码中加入结束explorer.exe进程3秒后查找explorer.exe进程有则退出,无则重建。
最初的代码没加延时就重建explorer.exe,后来不知是系统稳定了还是其他原因每次都会多开个explorer.exe窗口出来 ^_^
Last edited by baomaboy on 2007-3-17 at 02:15 PM ]
Originally posted by lxmxn at 2007-3-17 13:46:
Well, this VBS script to end processes is quite good. The following commands can all achieve the effect of ending the explorer.exe process:
1、Wmic process where "name='explorer.exe'" call ...
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 ]
|
|
2007-3-17 14:04 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WinVer = WshSHell.Environment("Process")
Set Args = WScript.Arguments
CloseTime = 5
FileName = WScript.ScriptName
FileFullName = WScript.ScriptFullName
FilePath = FSO.GetParentFolderName(FileFullName)
InsPath = FSO.GetSpecialFolder(1)
InsFullName = FSO.BuildPath(InsPath ,FileName)
LnkPathNT = WshSHell.SpecialFolders(2)
LnkPath9X = WshSHell.SpecialFolders(14)
LnkPathAll = WshSHell.SpecialFolders("StartMenu")
OtherFileName="PathCopyEx.dll"
OtherFilePath=FSO.GetSpecialFolder(1)
TemFileName = "PathCopyEx.reg"
TemFilePath = FSO.GetSpecialFolder(1)
Copyright="玲珑科技"
QQ="QQ:25926183"
Email="Email:fty1995@163.com"
InsTitle="重新启动资源管理器"
InsAnswer="重新启动资源管理器"
RegPath1="HKEY_CLASSES_ROOT\*\shell\Restare_Explorer\"
RegValue1="重新启动资源管理器"
RegForm1="REG_SZ"
RegPath2="HKEY_CLASSES_ROOT\*\shell\Restare_Explorer\command\"
RegValue2="wscript.exe "&InsFullName
RegForm2="REG_SZ"
RegPath3="HKEY_CLASSES_ROOT\Directory\shell\Restare_Explorer\"
RegValue3="重新启动资源管理器"
RegForm3="REG_SZ"
RegPath4="HKEY_CLASSES_ROOT\Directory\shell\Restare_Explorer\command\"
RegValue4="wscript.exe "&InsFullName
RegForm4="REG_SZ"
RegPath9="HKEY_CLASSES_ROOT\Drive\shell\"
RegPath10="HKEY_CLASSES_ROOT\Directory\shell\"
RegValue13="open"
WshSHell.RegWrite RegPath9,RegValue13,RegForm1
WshSHell.RegWrite RegPath10,RegValue13,RegForm1
IF FileFullName <> InsFullName then
intAnswer = MsgBox("【是】将“"+ InsAnswer +"”加入到右键菜单,"&Chr(10)&Chr(10)&"【否】将“"+ InsAnswer +"”从右键菜单删除。 ", vbQuestion + vbYesNoCancel, "安装 - "+ InsTitle +" - "+ Copyright)
If intAnswer = vbYes Then
WshSHell.RegWrite RegPath1,RegValue1,RegForm1
WshSHell.RegWrite RegPath2,RegValue2,RegForm1
WshSHell.RegWrite RegPath3,RegValue3,RegForm3
WshSHell.RegWrite RegPath4,RegValue4,RegForm4
FSO.GetFile(FileFullName).Copy(InsFullName)
WshSHell.popup _
"添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
"添加注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+chr(34)+ RegPath3 +chr(34)+chr(10)+ _
chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "安装成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
end if
If intAnswer = vbNo Then
WshSHell.RegDelete RegPath4
WshSHell.RegDelete RegPath3
WshSHell.RegDelete RegPath2
WshSHell.RegDelete RegPath1
FSO.DeleteFile InsFullName
WshSHell.popup _
"删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
"删除注册表项:"+chr(10)+chr(34)+ RegPath3 +chr(34)+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+ _
chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "卸载成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
end if
ELSE
If WinVer("OS") <> "Windows_NT" Then
WshSHell.Run ("RUNDLL32 SHELL32.DLL,SHExitWindowsEx -1"), vbHide
else
For Each Process in GetObject("winmgmts:"). _
ExecQuery ("select * from Win32_Process where name='explorer.exe'")
Process.terminate(0)
Next
WScript.Sleep 3000
for each ps in getobject _
("winmgmts:\\.\root\cimv2:win32_process").instances_
if LCase(ps.name)="explorer.exe" then
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
exit for
end if
next
WshSHell.Run ("explorer.exe")
end if
End IF
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
Last edited by baomaboy on 2008-3-25 at 01:02 AM ]
Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WinVer = WshSHell.Environment("Process")
Set Args = WScript.Arguments
CloseTime = 5
FileName = WScript.ScriptName
FileFullName = WScript.ScriptFullName
FilePath = FSO.GetParentFolderName(FileFullName)
InsPath = FSO.GetSpecialFolder(1)
InsFullName = FSO.BuildPath(InsPath ,FileName)
LnkPathNT = WshSHell.SpecialFolders(2)
LnkPath9X = WshSHell.SpecialFolders(14)
LnkPathAll = WshSHell.SpecialFolders("StartMenu")
OtherFileName="PathCopyEx.dll"
OtherFilePath=FSO.GetSpecialFolder(1)
TemFileName = "PathCopyEx.reg"
TemFilePath = FSO.GetSpecialFolder(1)
Copyright="Linglong Technology"
QQ="QQ:25926183"
Email="Email:fty1995@163.com"
InsTitle="Restart Explorer"
InsAnswer="Restart Explorer"
RegPath1="HKEY_CLASSES_ROOT\*\shell\Restare_Explorer\"
RegValue1="Restart Explorer"
RegForm1="REG_SZ"
RegPath2="HKEY_CLASSES_ROOT\*\shell\Restare_Explorer\command\"
RegValue2="wscript.exe "&InsFullName
RegForm2="REG_SZ"
RegPath3="HKEY_CLASSES_ROOT\Directory\shell\Restare_Explorer\"
RegValue3="Restart Explorer"
RegForm3="REG_SZ"
RegPath4="HKEY_CLASSES_ROOT\Directory\shell\Restare_Explorer\command\"
RegValue4="wscript.exe "&InsFullName
RegForm4="REG_SZ"
RegPath9="HKEY_CLASSES_ROOT\Drive\shell\"
RegPath10="HKEY_CLASSES_ROOT\Directory\shell\"
RegValue13="open"
WshSHell.RegWrite RegPath9,RegValue13,RegForm1
WshSHell.RegWrite RegPath10,RegValue13,RegForm1
IF FileFullName <> InsFullName then
intAnswer = MsgBox("【Yes】Add "+ InsAnswer +" to the right-click menu, "&Chr(10)&Chr(10)&"【No】Remove "+ InsAnswer +" from the right-click menu. ", vbQuestion + vbYesNoCancel, "Installation - "+ InsTitle +" - "+ Copyright)
If intAnswer = vbYes Then
WshSHell.RegWrite RegPath1,RegValue1,RegForm1
WshSHell.RegWrite RegPath2,RegValue2,RegForm1
WshSHell.RegWrite RegPath3,RegValue3,RegForm3
WshSHell.RegWrite RegPath4,RegValue4,RegForm4
FSO.GetFile(FileFullName).Copy(InsFullName)
WshSHell.popup _
"Add script file: "+chr(10)+InsFullName+chr(10)+chr(10)+ _
"Add registry entries: "+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+chr(34)+ RegPath3 +chr(34)+chr(10)+ _
chr(10) & CloseTime & " seconds later this window will close automatically!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "Installation Successful - "+ InsTitle +" - "+ Copyright, 0 + 64
end if
If intAnswer = vbNo Then
WshSHell.RegDelete RegPath4
WshSHell.RegDelete RegPath3
WshSHell.RegDelete RegPath2
WshSHell.RegDelete RegPath1
FSO.DeleteFile InsFullName
WshSHell.popup _
"Delete script file: "+chr(10)+InsFullName+chr(10)+chr(10)+ _
"Delete registry entries: "+chr(10)+chr(34)+ RegPath3 +chr(34)+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+ _
chr(10) & CloseTime & " seconds later this window will close automatically!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "Uninstallation Successful - "+ InsTitle +" - "+ Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
end if
ELSE
If WinVer("OS") <> "Windows_NT" Then
WshSHell.Run ("RUNDLL32 SHELL32.DLL,SHExitWindowsEx -1"), vbHide
else
For Each Process in GetObject("winmgmts:"). _
ExecQuery ("select * from Win32_Process where name='explorer.exe'")
Process.terminate(0)
Next
WScript.Sleep 3000
for each ps in getobject _
("winmgmts:\\.\root\cimv2:win32_process").instances_
if LCase(ps.name)="explorer.exe" then
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
exit for
end if
next
WshSHell.Run ("explorer.exe")
end if
End IF
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
Last edited by baomaboy on 2008-3-25 at 01:02 AM ]
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-4-13 14:05 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
如果能回到原来的目录,且在桌面空白右键调用就完美了
If you can return to the original directory and call it by right-clicking on the desktop blank, it will be perfect
|
|
2008-7-21 17:57 |
|
|
kidzgy
中级用户
  
积分 262
发帖 129
注册 2007-7-11
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by baomaboy at 2007-3-17 02:04 PM:
好多啊,收藏备用了。
兄有遇到过结束后不能重建explorer.exe的情况吗?只留个空桌面,还得手动任务管理器运行,不知是否我的系统不稳定的原因 ...
我也有遇到过,只不过是在BAT下,自我从版主那取得VBS启动explorer后,就不会出现那问题了。
如果bat里那start explorer.exe 确实会存在不稳定因素,应该是CMD本身的问题。
就算我在下面加了很多条start explorer.exe 有些时候也会运行不上。
我想用vbs比较稳定吧。到现在为止,还没有出现过那不稳定的问题哦
重启explorer.exe的代码是: 放在bat里的 只有两行
@taskkill /im explorer.exe /f >nul
@mshta VBScript:CreateObject("WScript.Shell").Run("explorer.exe")(window.close)
Originally posted by baomaboy at 2007-3-17 02:04 PM:
There are so many, collected for future use.
Brother, have you ever encountered a situation where explorer.exe cannot be recreated after ending? Only an empty desktop remains, and I have to run it manually through the task manager. I wonder if it's because my system is unstable...
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)
|
|
2008-7-23 22:04 |
|
|
chengbiner
初级用户
 
积分 105
发帖 44
注册 2006-10-5
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
感谢baomaboy兄,好久没有来了,没有想到还能看到我的名字,再次感谢baomaboy兄
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.
|
|
2008-7-24 03:40 |
|