中国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-09-23 16:11
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » The window of the BAT file will automatically close.
Printable Version  2,445 / 6
Floor1 024024 Posted 2006-03-24 11:15
初级用户 Posts 14 Credits 60
For example:

In the BAT statement, we only have such a sentence:

NOTEPAD AA.TXT

After running, the BAT window will not disappear until you close the notepad, and then the BAT window will close.

What I want to do is how to make the BAT file window automatically close as soon as NOTEPAD is opened.

I have tried using CALL or START to call NOTEPAD.EXE, but it doesn't work.
Floor2 Climbing Posted 2006-03-24 12:36
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
It's okay to use start. It was tested successfully under 2003. The content is as follows:

@echo off
start notepad.exe
Floor3 bagpipe Posted 2006-03-24 13:31
银牌会员 Posts 425 Credits 1,144 From 北京
Brother Shitou seems to be missing a parameter??? START /WAIT program. I don't know if /WAIT is needed in 2003, but it's still needed in the 2000 system. LZ can test it
Floor4 024024 Posted 2006-03-24 14:14
初级用户 Posts 14 Credits 60
Originally posted by bagpipe at 2006-3-24 13:31:
Brother Shi Tou seems to be missing a parameter??? START /WAIT program, I don't know if /WAIT is needed in 2003, it's still needed in 2000 system. LZ can test it


I tried it under XP + SP2, no need for /WAIT.
THANK YOU TWO
Floor5 Climbing Posted 2006-03-24 17:15
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
Heheh, if you add /wait, then you really can't close the cmd window.
Floor6 bagpipe Posted 2006-03-25 09:19
银牌会员 Posts 425 Credits 1,144 From 北京
Originally posted by Climbing at 2006-3-24 17:15:
Hey, if you add /wait, then the cmd window really can't be closed.



I think I didn't misinterpret the LZ's meaning. The situation I mentioned is under the WIN 2000 system. The LZ's meaning is: "In the BAT statement, we only have such a sentence:

NOTEPAD AA.TXT

After running, the BAT window won't disappear until you close the notepad, and then the BAT window will close." I don't know whether the LZ runs the BAT and then closes the CMD or keeps the CMD window after running and then closes the CMD after ending the program. I don't understand.............................What does the LZ mean!!! Alas
Floor7 lymygee Posted 2006-04-17 17:48
新手上路 Posts 3 Credits 5
I also encountered this situation. Adding a START solved it. Thanks.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023