China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 06:03
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to use batch processing to close and reopen the explorer process View 4,067 Replies 16
Original Poster Posted 2006-05-16 11:31 ·  中国 安徽 马鞍山 电信
社区乞丐
Credits -27
Posts 45
Joined 2006-05-16 11:25
20-year member
UID 55616
Status Offline
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 ]
Floor 2 Posted 2006-05-16 15:04 ·  中国 湖北 荆州 电信
高级用户
★★★
Credits 994
Posts 444
Joined 2005-01-29 00:00
21-year member
UID 35779
Gender Male
Status Offline
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 ]
Floor 3 Posted 2006-05-16 18:46 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
It's not that it's been hacked, but that your explorer wasn't completely closed. There might be multiple explorer processes present.
Floor 4 Posted 2006-05-17 08:44 ·  中国 湖北 荆州 电信
高级用户
★★★
Credits 994
Posts 444
Joined 2005-01-29 00:00
21-year member
UID 35779
Gender Male
Status Offline
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
Floor 5 Posted 2006-05-24 00:53 ·  中国 山西 太原 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline

───────────────── 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:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 6 Posted 2006-05-24 10:04 ·  中国 广东 深圳 电信
初级用户
Credits 82
Posts 31
Joined 2006-05-23 00:33
20-year member
UID 55824
Status Offline
taskkill /f /im explorer.exe && start C:\WINDOWS\explorer.exe
Floor 7 Posted 2006-05-24 18:45 ·  中国 四川 成都 鹏博士宽带
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
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)
Floor 8 Posted 2006-05-24 19:02 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
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.
Floor 9 Posted 2006-05-25 15:11 ·  中国 广东 深圳 电信
初级用户
Credits 82
Posts 31
Joined 2006-05-23 00:33
20-year member
UID 55824
Status Offline
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
Floor 10 Posted 2006-05-25 15:21 ·  中国 湖北 荆州 电信
高级用户
★★★
Credits 994
Posts 444
Joined 2005-01-29 00:00
21-year member
UID 35779
Gender Male
Status Offline
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.
Floor 11 Posted 2006-09-19 09:19 ·  新加坡 腾讯云
初级用户
Credits 73
Posts 30
Joined 2006-09-18 08:35
19-year member
UID 62944
Status Offline
::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
Floor 12 Posted 2006-09-19 09:41 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

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'>"
Floor 13 Posted 2006-10-16 01:09 ·  中国 广东 东莞 电信
初级用户
Credits 63
Posts 18
Joined 2006-09-09 08:41
19-year member
UID 62219
Status Offline
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?
Floor 14 Posted 2006-10-16 16:59 ·  中国 河南 安阳 电信
初级用户
Credits 39
Posts 15
Joined 2006-10-14 07:42
19-year member
UID 65719
Status Offline
Maybe it's toxic. The shutdown interface shouldn't pop up. You check again if it's a setting issue.
Floor 15 Posted 2006-10-17 02:42 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Forum Jump: