中国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-18 20:42
47,814 topics / 349,908 posts / today 1 new / 48,259 members
DOS疑难解答 & 问题讨论 (解答室) » How to close all windows
Printable Version  1,577 / 6
Floor1 bgwzlgf9610 Posted 2007-04-28 05:04
初级用户 Posts 12 Credits 30
In the Windows XP system, users often open many windows simultaneously, such as frequently opening a dozen web pages and programs, which causes system resource strain and slow running speed. I want to use cmd to make a batch script to forcibly close all open windows and programs, but not to shut down or log off. Please teach me how to do it.

[ Last edited by bgwzlgf9610 on 2007-4-27 at 04:36 PM ]
Floor2 lxmxn Posted 2007-04-28 06:42
版主 Posts 4,938 Credits 11,386
You can first write a process list into a file, for example, store the processes to be closed in it, and then use a batch script to read the contents of this file to close the relevant processes to achieve the purpose. This file can also store the list of processes that are not to be closed.
Floor3 bgwzlgf9610 Posted 2007-04-28 23:25
初级用户 Posts 12 Credits 30
Thanks, moderator lxmxn.
What I'm talking about here is the randomly opened web pages, games, and program windows by students. Then how to distinguish the content of the process list I get, so as not to close the system processes but only close the content I want to close?
Floor4 lxmxn Posted 2007-04-29 02:48
版主 Posts 4,938 Credits 11,386
Re bgwzlgf9610:

You can write several main processes of the system in 1.txt, one per line, and then write a batch script to end processes that are not in this file, so that you can close the processes you want to close.

The content in 1.txt is actually the list of processes you don't want to close.
Floor5 bgwzlgf9610 Posted 2007-04-29 03:56
初级用户 Posts 12 Credits 30
The ideas of the moderator are very inspiring, thank you first.
But I have tried for a long time without substantial progress. I wonder if the moderator can be so kind as to give a specific example.
For example: There are three processes, explorer, csrss and xiandan.exe. I want to end xiandan.exe while keeping explorer and csrss.
Can it be written like this in 1.txt:
explorer
csrss
.
The key is how to do it with a batch script. I don't know how. I have tried for a long time and haven't completed it. I have searched for a long time on the forum and haven't found the content I want.
Floor6 lxmxn Posted 2007-04-29 04:11
版主 Posts 4,938 Credits 11,386
Re bgwzlgf9610:

Your 1.txt can write the processes to end, for example:
xiandan.exe
qq.exe

Then use this:
Floor7 bgwzlgf9610 Posted 2007-04-29 04:23
初级用户 Posts 12 Credits 30
Thanks to lxmxn for his enthusiastic help and hard work.
I have already known how to solve similar problems.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023