中国DOS联盟论坛

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-02 07:09
48,037 topics / 350,122 posts / today 2 new / 48,250 members
DOS批处理 & 脚本技术(批处理室) » [Help] How to use batch processing to close and reopen the explorer process
Printable Version  4,070 / 16
Floor1 sexfio Posted 2006-05-16 11:31
社区乞丐 Posts 45 Credits -27
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;)

[ Last edited by willsort on 2006-5-24 at 00:51 ]
Floor2 jawbin Posted 2006-05-16 15:04
高级用户 Posts 444 Credits 994
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 ]
Floor3 electronixtar Posted 2006-05-16 18:46
铂金会员 Posts 2,672 Credits 7,493
It's not that it's been hacked, but that your explorer wasn't completely closed. There might be multiple explorer processes present.
Floor4 jawbin Posted 2006-05-17 08:44
高级用户 Posts 444 Credits 994
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
Floor5 willsort Posted 2006-05-24 00:53
元老会员 Posts 1,512 Credits 4,432

───────────────── 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 ─────────────────
Floor6 fan927 Posted 2006-05-24 10:04
初级用户 Posts 31 Credits 82
taskkill /f /im explorer.exe && start C:\WINDOWS\explorer.exe
Floor7 namejm Posted 2006-05-24 18:45
荣誉版主 Posts 1,737 Credits 5,226 From 成都
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)
Floor8 3742668 Posted 2006-05-24 19:02
荣誉版主 Posts 718 Credits 2,013
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.
Floor9 fan927 Posted 2006-05-25 15:11
初级用户 Posts 31 Credits 82
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
Floor10 jawbin Posted 2006-05-25 15:21
高级用户 Posts 444 Credits 994
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.
Floor11 mobo Posted 2006-09-19 09:19
初级用户 Posts 30 Credits 73
::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
Floor12 electronixtar Posted 2006-09-19 09:41
铂金会员 Posts 2,672 Credits 7,493
Floor13 002500 Posted 2006-10-16 01:09
初级用户 Posts 18 Credits 63
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?
Floor14 mydoslg Posted 2006-10-16 16:59
初级用户 Posts 15 Credits 39
Maybe it's toxic. The shutdown interface shouldn't pop up. You check again if it's a setting issue.
Floor15 不得不爱 Posted 2006-10-17 02:42
超级版主 Posts 2,044 Credits 5,310 From 四川南充
It's a pity that taskkill wasn't available in Windows 2000 yet!
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023