|
sexfio
社区乞丐
积分 -27
发帖 45
注册 2006-5-16
状态 离线
|
『楼 主』:
[求助]如何使用批处理关闭并重新打开explorer进程
使用 LLM 解释/回答一下
因为经常有某些文件删除不掉,但是关闭explorer进程,再打开就能删掉
所以我想写个直接关闭explorer再打开的bat命令
我这样写的:
ntsd -c q -pn explorer.exe
c:\windows\explorer.exe
exit
但是我发现打开的是资源管理器啊,我在用任务管理器打开explorer的时候是不弹出资源管理器的,还有exit似乎没退出cmd,如果解决这2个问题呢,谢谢;)
Last edited by willsort on 2006-5-24 at 00:51 ]
Because there are often some files that cannot be deleted, but closing the explorer process and then opening it again can delete them. So I want to write a bat command that directly closes explorer and then opens it again. The way I wrote is:
ntsd -c q -pn explorer.exe
c:\windows\explorer.exe
exit
But I found that what is opened is the Windows Explorer. When I use the task manager to open explorer, the Windows Explorer is not popped up. Also, the exit seems not to exit the cmd. How to solve these two problems, thank you;)
[[i] Last edited by willsort on 2006-5-24 at 00:51 [/i]]
|
|
2006-5-16 11:31 |
|
|
jawbin
高级用户
   
积分 994
发帖 444
注册 2005-1-29
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
explorer.exe 就是资源管理器啊, 它是 windows 指定的缺省 shell
另外可能是你的 explorer.exe 被入侵了, 扫描一下病毒或者可疑程序吧
Last edited by jawbin on 2006-5-16 at 15:05 ]
explorer.exe is the resource manager, and it's the default shell specified by Windows. Additionally, maybe your explorer.exe has been compromised. Scan for viruses or suspicious programs.
Last edited by jawbin on 2006-5-16 at 15:05 ]
|
|
2006-5-16 15:04 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
不是被入侵了,是你的explorer没关完。有可能有多个explorer进程存在
It's not that it's been hacked, but that your explorer wasn't completely closed. There might be multiple explorer processes present.
|
|
2006-5-16 18:46 |
|
|
jawbin
高级用户
   
积分 994
发帖 444
注册 2005-1-29
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
哦,我误会了,呵呵, 总想着防毒,都给搞怕了
正在被 explorer.exe 使用啊, 呵呵
Oh, I made a mistake, heh heh. I always think about anti-virus, and it's made me scared. It's being used by explorer.exe right now, heh heh
|
|
2006-5-17 08:44 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
───────────────── 版务记录 ─────────────────
执行:Will Sort
操作:修改标题 - 20675 - 请教高手个问题:)
处罚:因属论坛新人,不予积分处罚
提示:请访问 {7326}论坛新手必读,所有人的基本行为准则
───────────────── 版务记录 ─────────────────
───────────────── 版务记录 ─────────────────
执行:Will Sort
操作:移动主题:自《DOS疑難解答 & 問題討論 (解答室)》
说明:依照主题内容分类,更适合于发表在此版区
提示:原版区转向链接三日后将删除
处罚:因属论坛新人,不予积分处罚
───────────────── 版务记录 ─────────────────
───────────────── Moderation Record ─────────────────
Performed by: Will Sort
Action: Modify Title - 20675 - Asking an expert a question:)
Punishment: No points punishment due to being a new forum member
Tip: Please visit {7326}Read Before Posting, Basic Code of Conduct for Everyone
───────────────── Moderation Record ─────────────────
───────────────── Moderation Record ─────────────────
Performed by: Will Sort
Action: Move Topic: From "DOS Difficulties & Questions Discussion (Q&A Room)"
Description: Classified according to the topic content, more suitable to be posted in this forum area
Tip: The original area transfer link will be deleted after three days
Punishment: No points punishment due to being a new forum member
───────────────── Moderation Record ─────────────────
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2006-5-24 00:53 |
|
|
fan927
初级用户
 
积分 82
发帖 31
注册 2006-5-23
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
taskkill/f /im explorer.exe &&start C:\WINDOWS\explorer.exe
taskkill /f /im explorer.exe && start C:\WINDOWS\explorer.exe
|
|
2006-5-24 10:04 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by fan927 at 2006-5-24 10:04:
taskkill/f /im explorer.exe &&start C:\WINDOWS\explorer.exe
因为C:\WINDOWS是CMD默认的搜索路径,因此可以直接用start explorer (如果%path%路径里再没有其他文件名相同而扩展名不同的程序,甚至可以省略 .exe)
Originally posted by fan927 at 2006-5-24 10:04:
taskkill/f /im explorer.exe &&start C:\WINDOWS\explorer.exe
Because C:\WINDOWS is the default search path for CMD, so you can directly use start explorer (if there are no other programs with the same filename but different extensions in the %path% path, you can even omit the .exe)
|
|
2006-5-24 18:45 |
|
|
3742668
荣誉版主
      
积分 2013
发帖 718
注册 2006-2-18
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
其实只需要一句taskkill /fi "IMAGENAME eq Explorer.exe"
如果权限足够的话,从命令行不管用TASKKILL命令,或者用WMIC的process子命令结束explorer进程后,explorer进程都会自动启动,中间的间隔大概有3秒(我的电脑上是这样)。所以就不难理解为何楼主启动explorer时会启动资源管理器。
Actually, just one line is needed: taskkill /fi "IMAGENAME eq Explorer.exe"
If the permissions are sufficient, if the TASKKILL command is not used from the command line, or if the explorer process is ended using the WMIC process subcommand, the explorer process will automatically start. The interval in between is approximately 3 seconds (on my computer it is like this). So it is not difficult to understand why the building owner's startup of explorer will start the File Explorer.
|
|
2006-5-24 19:02 |
|
|
fan927
初级用户
 
积分 82
发帖 31
注册 2006-5-23
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
因为C:\WINDOWS是CMD默认的搜索路径,因此可以直接用start explorer (如果%path%路径里再没有其他文件名相同而扩展名不同的程序,甚至可以省略.exe)
多谢指点,是这样的
Because C:\WINDOWS is the default search path for CMD, so you can directly use start explorer (if there are no other programs with the same file name but different extensions in the %path% path, you can even omit .exe)
Thanks for the advice, that's right
|
|
2006-5-25 15:11 |
|
|
jawbin
高级用户
   
积分 994
发帖 444
注册 2005-1-29
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
对,因为它会自动载入,所以应该去掉
c:\windows\explorer.exe
这一行
另外 start 不带路径以及扩展名的话, 要小心病毒
Yes, because it will load automatically, so this line should be removed: c:\windows\explorer.exe. Also, be careful with viruses when start is used without path and extension.
|
|
2006-5-25 15:21 |
|
|
mobo
初级用户
 
积分 73
发帖 30
注册 2006-9-18
状态 离线
|
『第 11 楼』:
关程序两种方法--结束任务,终止进程
使用 LLM 解释/回答一下
::两种关程序的方法-------------结束任务,终止进程:
::结束任务:
taskkill /fi "imagename eq notepad.exe"
::用WMI方式,终止进程:
wmic process where name="notepad.exe" call terminate
::Two methods to close the program ------------- End task, terminate process:
::End task:
taskkill /fi "imagename eq notepad.exe"
::Terminate the process using WMI method:
wmic process where name="notepad.exe" call terminate
|
|
2006-9-19 09:19 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
或者ntsd
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-9-19 09:41 |
|
|
002500
初级用户
 
积分 63
发帖 18
注册 2006-9-9
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
很奇怪的是用批处理关闭explorer 没成功 却弹出了关机界面?
C:\>taskkill /im explorer.exe
SUCCESS: The process "explorer.exe" with PID 7864 has been terminated.
难道有毒?
It's very strange that the batch processing failed to close explorer but popped up the shutdown interface?
C:\>taskkill /im explorer.exe
SUCCESS: The process "explorer.exe" with PID 7864 has been terminated.
Is there a virus?
|
|
2006-10-16 01:09 |
|
|
mydoslg
初级用户
 
积分 39
发帖 15
注册 2006-10-14
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
可能有毒吧,不应该弹出关机界面的,你再检查一下是不是设置的原因
Maybe it's toxic. The shutdown interface shouldn't pop up. You check again if it's a setting issue.
|
|
2006-10-16 16:59 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-10-17 02:42 |
|