无忧启动论坛

 找回密码
 注册
搜索

分解explorer进程,重启桌面而不关闭资源管理器

查看数: 4882 | 评论数: 14 | 收藏 4
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2018-11-4 07:42

正文摘要:

wmic process where caption="notepad.exe" get caption,commandline /value【精确查找】获取两个explorer进程的命令行,判断哪个是桌面,哪个是资源管理器,然后实现只重启资源管理器。

回复

Dream漂移 发表于 2018-11-6 22:01:01

谢谢楼主分享技术资料!!很感兴趣!!
nttwqz 发表于 2018-11-4 13:02:24
窄口牛 发表于 2018-11-4 12:12
论坛的锅
@echo off
reg add "HKCR\Directory\Background\shell\RestartExplorer" /ve /d "重启资源管 ...



论坛的代码还有其它问题记得,不太好用

我改成按shift键出来了,一般隐藏
nttwqz 发表于 2018-11-4 11:50:52
窄口牛 发表于 2018-11-4 11:12
谢谢提示
成品来了

注册表键值中含有引号,批处理中必须使用\转义
窄口牛 发表于 2018-11-4 11:26:36
嗯,应该是的。
nttwqz 发表于 2018-11-4 11:24:10
窄口牛 发表于 2018-11-4 10:21
你得先修改注册表,变成分离explorer
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Softwa ...

直接改文件夹选项“在单独的进程中打开文件夹窗口”一样。
窄口牛 发表于 2018-11-4 11:12:30
本帖最后由 窄口牛 于 2018-11-4 12:13 编辑

谢谢提示
成品来了
  1. @echo off
  2. reg add "HKCR\Directory\Background\shell\RestartExplorer" /ve /d "重启资源管理器" /f
  3. reg add "HKCR\Directory\Background\shell\RestartExplorer\Command" /ve /d "cmd /c \"wmic process where \"caption='explorer.exe' and  not commandline like '%%%%factory%%%%'\" call terminate\"" /f
复制代码

点评

注册表键值中含有引号,批处理中必须使用\转义  详情 回复 发表于 2018-11-4 11:50
slore 发表于 2018-11-4 10:41:47
  1. wmic process where "caption='explorer.exe' and  not commandline like '%factory%'" call terminate
复制代码
窄口牛 发表于 2018-11-4 10:21:57
本帖最后由 窄口牛 于 2018-11-4 10:51 编辑

你得先修改注册表,变成分离explorer
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"SeparateProcess"=dword:00000001

点评

直接改文件夹选项“在单独的进程中打开文件夹窗口”一样。  详情 回复 发表于 2018-11-4 11:24
nttwqz 发表于 2018-11-4 09:24:12
窄口牛 发表于 2018-11-4 08:53
两个进程为
Caption=explorer.exe
CommandLine=C:\Windows\Explorer.EXE

现在的结果是这样的,打开了一个资源管理器窗口。。。

Caption=explorer.exe
CommandLine=explorer.exe
窄口牛 发表于 2018-11-4 08:53:41
两个进程为
Caption=explorer.exe
CommandLine=C:\Windows\Explorer.EXE
Caption=explorer.exe
CommandLine=C:\Windows\explorer.exe /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} -Embedding
挑选结束上面的,下面的是资源管理的
wmic process where "caption='explorer.exe' and get commandline /value<>'C:\Windows\explorer.exe /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} -Embedding'" call Terminate
这么写不对,正在琢磨该怎么写

点评

现在的结果是这样的,打开了一个资源管理器窗口。。。 Caption=explorer.exe CommandLine=explorer.exe  详情 回复 发表于 2018-11-4 09:24
nttwqz 发表于 2018-11-4 08:41:56

然后呢?怎么办才能不关闭资源管理器重启桌面?

下面这句是重启了,但是资源管理器也关闭了。
wmic process where caption="explorer.exe" call terminate
窄口牛 发表于 2018-11-4 08:08:44
网上搜的范例。

点评

然后呢?怎么办才能不关闭资源管理器重启桌面? 下面这句是重启了,但是资源管理器也关闭了。 wmic process where caption="explorer.exe" call terminate  详情 回复 发表于 2018-11-4 08:41
nttwqz 发表于 2018-11-4 07:45:49
为什么是notepad.exe

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-6-8 20:27

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表