![]() |
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 14:52 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » How to customize parameters in batch commands? |
| Printable Version 2,622 / 9 |
| Floor1 klot | Posted 2005-02-20 00:00 |
| 初级用户 Posts 22 Credits 168 | |
|
How to customize parameters in batch commands? I usually use only system parameters. If I want to customize parameters, how should I do it? For example, I made a program with a batch file called test.bat, and I want to add a parameter to it. Thanks. Thanks
|
|
| Floor2 Climbing | Posted 2005-02-20 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
Read more old posts, especially the sticky ones, don't just know to ask.
|
|
| Floor3 DOSforever | Posted 2005-02-20 00:00 |
| 金牌会员 Posts 2,239 Credits 4,639 | |
|
How to define custom parameters for batch commands? The parameters of batch commands are originally input from the command line when you execute it. You can input any parameters you want to give it, from %1 to %9
|
|
| Floor4 klot | Posted 2005-02-22 00:00 |
| 初级用户 Posts 22 Credits 168 | |
|
??I'm too noob... still don't understand.... Please everyone take a look at my this program: This batch file's name is test.bat
@echo off IF "%1"=="o" goto ok else goto no : ok echo dkfjlsfj>>ok.txt : no echo dkfjlsfj>>no.txt I run "test.bat o" but the program didn't make a selection. Just executed both of those two lines.... Don't understand... |
|
| Floor5 chenhui530 | Posted 2005-02-22 00:00 |
| 高级用户 Posts 273 Credits 772 | |
The following is a quote from klot's post on 2005-2-22 11:00:25: Your batch has an issue. Change it as follows: @echo off IF "%1"=="o" (goto ok) else (goto no) : ok echo dkfjlsfj>>ok.txt goto end : no echo dkfjlsfj>>no.txt :end |
|
| Floor6 Climbing | Posted 2005-02-22 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
The more I modify, the more problems there are. What the person upstairs modified can only run in the NT environment.
|
|
| Floor7 31415926 | Posted 2005-02-22 00:00 |
| 初级用户 Posts 3 Credits 110 | |
|
It seems there is no "else" in Windows 98 SE?
|
|
| Floor8 klot | Posted 2005-02-22 00:00 |
| 初级用户 Posts 22 Credits 168 | |
|
Thanks everyone's help!!! But I'm just straightforward. Climbing, you just talk but don't do. And that post, I really doubt whether you understand DOS. It's better to help everyone solve problems well than to talk so much nonsense if you have time. What I said might be excessive. Please forgive me
|
|
| Floor9 chenhui530 | Posted 2005-02-22 00:00 |
| 高级用户 Posts 273 Credits 772 | |
|
@echo off
IF "%1"=="o" goto ok goto no : ok echo dkfjlsfj>>ok.txt goto end : no echo dkfjlsfj>>no.txt :end |
|
| Floor10 Climbing | Posted 2005-02-23 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
The following is the statement made by klot on 2005-2-22 16:51:09: Or I don't understand DOS, but I can be certain that those who only know how to ask questions but don't know to check old threads for learning will definitely not learn anything too useful, because it's obvious that you are lacking in the spirit of hard - working study. If you had taken a little look at the sticky posts, you should have known whether Climbing is the kind of person who talks nonsense and just talks but doesn't do. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |