中国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-25 23:18
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » How to automatically close the command line window
Printable Version  16,249 / 40
Floor1 cr2516 Posted 2006-07-20 13:25
初级用户 Posts 12 Credits 32
After the script finishes running, how can I make the command line window close automatically
Floor2 flying008 Posted 2006-07-20 13:30
中级用户 Posts 103 Credits 245
Hehe……Just write EXIT at the last sentence of the batch file,
echo off
start d:\123\456.exe If you run a WINDOWS program, use the START command to start it without waiting
exit The command line window automatically closes after the batch script finishes running
Floor3 cr2516 Posted 2006-07-20 13:35
初级用户 Posts 12 Credits 32
It doesn't work. As soon as I run the script, both the program and the command line window pop up.
Floor4 cr2516 Posted 2006-07-20 13:38
初级用户 Posts 12 Credits 32
What I mean is to manually run the script to display the program but without showing the command line window. I tried adding exit but it didn't work.
Floor5 namejm Posted 2006-07-20 13:49
荣誉版主 Posts 1,737 Credits 5,226 From 成都
"However, it is not in the form of a command line window" How to understand this sentence? If you can't even describe it clearly yourself, how can you let others answer?
Floor6 cr2516 Posted 2006-07-20 13:55
初级用户 Posts 12 Credits 32
A script to run a player. After clicking, the player runs and the command line window is displayed. Can the command line window not be displayed while the program is running?
Floor7 fastslz Posted 2006-07-20 14:26
铂金会员 Posts 2,315 Credits 5,493 From 上海
Post the script.
Floor8 cr2516 Posted 2006-07-20 14:34
初级用户 Posts 12 Credits 32
1.bat

d:
cd D:\Program Files\Ringz Studio\Storm Codec
mplayerc.exe -play -add D:\TDdownload\1.asf

Every time I double-click to run 1.bat, both the player and the command line window pop up
Floor9 cr2516 Posted 2006-07-20 14:35
初级用户 Posts 12 Credits 32
My system is XP
Floor10 namejm Posted 2006-07-20 14:52
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Oh, it turns out it's Storm Video. I don't have it installed on my computer and don't want to install it. I've heard there are tons of plugins.

This is because Storm Video was called to open a video and audio file, so the CMD window won't close until Storm Video is closed. If you don't want to automatically open a certain video and audio file, change mplayerc.exe -play -add D:\TDdownload\1.asf to start mplayerc.exe, then the CMD window can close after starting Storm Video, and then you can manually open the specified video and audio file.
Floor11 cr2516 Posted 2006-07-20 15:15
初级用户 Posts 12 Credits 32
Expert! You added "start" before "mplayerc.exe -play -add D:\TDdownload\1.asf", and when you click to run it, the command line window doesn't show up because the "start" command in Windows is used to start a separate process in the background without displaying the command prompt window.
Floor12 namejm Posted 2006-07-20 15:31
荣誉版主 Posts 1,737 Credits 5,226 From 成都
I can't clearly explain the specific reason. According to my habit, if I call an external program and don't want to wait for the external program to exit to perform the next operation, I add "start" in front.

Looking forward to experts' in-depth theoretical analysis. Hehe.
Floor13 cr2516 Posted 2006-07-20 16:53
初级用户 Posts 12 Credits 32
hehe Still, thank you very much
Floor14 zh159 Posted 2006-07-20 17:18
金牌会员 Posts 1,467 Credits 3,687
start: Run the specified program or command in another window. The batch processing in the current window continues to run without waiting for the other window to finish running
Floor15 Scott0902 Posted 2006-07-20 18:53
中级用户 Posts 237 Credits 466
If it's about using Baofeng Video Player to open a video, there's no need to use batch processing. Creating a shortcut is easier. This shortcut only needs one command: "D:\Program Files\Ringz Studio\Storm Codec\mplayerc.exe" -play -add D:\TDdownload\1.asf
1 2 3  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023