![]() |
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:03 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » How to use intelligent startup multi-program batch commands under XP! <Closed and Settled> |
| Printable Version 2,830 / 13 |
| Floor1 cjw114 | Posted 2005-11-07 20:21 |
| 新手上路 Posts 7 Credits 18 | |
|
I want to make a batch file for starting multiple programs. For example, pressing 1 starts QQ, pressing 2 starts IE, pressing 3 starts BT, and pressing Enter exits the command window. I plan to use the Start and GOTO commands to implement it. Please teach me experts: How can I wait and judge the keyboard input??
---------------------------------------------------------------------- 『Post 5』: Please help me see where is wrong, why is there no response under xp? @ echo 1. Start QQ-1 @ echo 2. Start BT download @ echo 3. Start Maxthon browser @ echo 4. Start QQ-2 @ echo 0. Exit choice /c 12340 /m "Please select the program code you need to start:" if errorlevel 5 goto end if errorlevel 4 goto qq2 if errorlevel 3 goto myie if errorlevel 2 goto bt if errorlevel 1 goto qq1 :qq2 start D:\Progra~1\Tencent\qq1\CoralQQ.exe :myie start D:\Maxthon\Maxthon.exe :bt start D:\Progra~1\BitComet\BitComet.exe :qq1 start D:\Progra~1\Tencent\qq\CoralQQ.exe :end exit [ Last edited by cjw114 on 2005-11-12 at 00:34 ] |
|
| Floor2 GOTOmsdos | Posted 2005-11-07 20:43 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
choice
But it needs to be identified by the return code |
|
| Floor3 220110 | Posted 2005-11-07 21:24 |
| 荣誉版主 Posts 313 Credits 718 | |
|
Please check if there is CHOICE.COM in your XP.
|
|
| Floor4 cjw114 | Posted 2005-11-07 21:28 |
| 新手上路 Posts 7 Credits 18 | |
|
No, what should I do? Where can I find it?
|
|
| Floor5 220110 | Posted 2005-11-07 21:34 |
| 荣誉版主 Posts 313 Credits 718 | |
|
http://www.cn-dos.net/forum/viewthread.php?tid=17250&fpage=1&highlight=choice
Sent by friend Michael. (But there are some problems when running in my XP) |
|
| Floor6 cjw114 | Posted 2005-11-07 21:38 |
| 新手上路 Posts 7 Credits 18 | |
|
Thanks
|
|
| Floor7 cjw114 | Posted 2005-11-07 21:40 |
| 新手上路 Posts 7 Credits 18 | |
|
Why still not working??? So anxious!
That choice doesn't seem right. Under XP, the DOS window becomes English. Are there any other methods? [ Last edited by cjw114 on 2005-11-7 at 21:45 ] |
|
| Floor8 220110 | Posted 2005-11-07 21:51 |
| 荣誉版主 Posts 313 Credits 718 | |
Originally posted by cjw114 at 2005-11-7 21:40: I also noticed this problem. Need to ask Michael to help guide. |
|
| Floor9 cjw114 | Posted 2005-11-07 22:00 |
| 新手上路 Posts 7 Credits 18 | |
|
@ echo Press the keyboard to start QQ1+BT+MyIE program, press again to start QQ2, to exit please close this window!
pause start D:\Progra~1\Tencent\qq\CoralQQ.exe start D:\Progra~1\BitComet\BitComet.exe start D:\Maxthon\Maxthon.exe pause start D:\Progra~1\Tencent\qq1\CoralQQ.exe -------------------------------- |
|
| Floor10 Archimonde | Posted 2005-11-08 17:00 |
| 新手上路 Posts 2 Credits 3 | |
|
According to your meaning, I wrote one, for reference only
@echo off echo 1. Start QQ-1 echo 2. Start BT download echo 3. Start Maxthon browser echo 4. Start QQ-2 echo 0. Exit :INPUT set /p Input_=Please select the program code to start: if %Input_% == "4" goto QQ2 if %Input_% == "3" goto MYIE if %Input_% == "2" goto BT if %Input_% == "1" goto QQ1 if %Input_% == "0" goto END echo Incorrect parameter entered. Please try again. goto INPUT :END @echo on exit :QQ2 start D:\Progra~1\Tencent\qq1\CoralQQ.exe goto END :MYIE start D:\Maxthon\Maxthon.exe goto END :BT start D:\Progra~1\BitComet\BitComet.exe goto END :QQ1 start D:\Progra~1\Tencent\qq\CoralQQ.exe goto END [ Last edited by Archimonde on 2005-11-8 at 17:25 ] |
|
| Floor11 0401 | Posted 2005-11-09 22:13 |
| 中级用户 Posts 88 Credits 435 | |
|
Add a line
set Input_=%Input_:~0,1% Otherwise, an error will occur when the input characters are excessive~ |
|
| Floor12 cjw114 | Posted 2005-11-10 12:47 |
| 新手上路 Posts 7 Credits 18 | |
|
After testing, Comrade Archimonde's commands always go wrong, no matter what characters are entered. Please re-enter
|
|
| Floor13 不得不爱 | Posted 2005-11-10 17:54 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
According to your meaning, I wrote one, for reference only
@echo off echo 1. Start QQ-1 echo 2. Start BT download echo 3. Start Maxthon browser echo 4. Start QQ-2 echo 0. Exit :INPUT set /p In=Please select the program code to start: set In=%In:~0,1% if #%In% ==#4 goto QQ2 if #%In% ==#3 goto MYIE if #%In% == #2 goto BT if #%In% == #1 goto QQ1 if #%In% == #0 goto END echo Incorrect parameter entered. Please try again. goto INPUT :END @echo on exit :QQ2 start D:\Progra~1\Tencent\qq1\CoralQQ.exe goto END :MYIE start D:\Maxthon\Maxthon.exe goto END :BT start D:\Progra~1\BitComet\BitComet.exe goto END :QQ1 start D:\Progra~1\Tencent\qq\CoralQQ.exe :END |
|
| Floor14 cjw114 | Posted 2005-11-12 00:31 |
| 新手上路 Posts 7 Credits 18 | |
|
Finally, the INPUT function should be returned. Therefore, the final code is as follows:
@echo off echo 1. Start QQ-1 echo 2. Start BT download echo 3. Start Maxthon browser echo 4. Start QQ-2 echo 0. Exit :INPUT set /p In=Please select the program code to start: set In=%In:~0,1% if #%In% ==#4 goto QQ2 if #%In% ==#3 goto MYIE if #%In% == #2 goto BT if #%In% == #1 goto QQ1 if #%In% == #0 goto END echo Incorrect parameter entered. Please try again. goto INPUT :END @echo on exit :QQ2 start D:\Progra~1\Tencent\qq1\CoralQQ.exe goto INPUT :MYIE start D:\Maxthon\Maxthon.exe goto INPUT :BT start D:\Progra~1\BitComet\BitComet.exe goto INPUT :QQ1 start D:\Progra~1\Tencent\qq\CoralQQ.exe goto INPUT |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |