Hi,
I am making a batch program and the user is allowed to do inputs. The program will be called "List.bat" and the user should be able to type things such as "list.bat /v" or something like that.
I need help with setting the strings for the program.
Any help would be appreciated,
Rileyh
How to set switches in a batch file
Moderator: DosItHelp
Re: How to set switches in a batch file
aGerman,
Thanks for the post.
What am I supposed to put in the "REM your code here" section? (I mean, do I need to put code there for the above code or does is it just a statement, such as "@set var"?)
Regards,
Rileyh
Thanks for the post.
What am I supposed to put in the "REM your code here" section? (I mean, do I need to put code there for the above code or does is it just a statement, such as "@set var"?)
Regards,
Rileyh
Re: How to set switches in a batch file
Again replace the REM line with your code which should be executed if the batch file was called with /v as first argument.
Regards
aGerman
Regards
aGerman
Re: How to set switches in a batch file
aGerman,
Thank you for that. Out of interest, what is the "~" supposed to do?
I didn't mean for the switch to be called, moreso as an "extra command" (you would type it into cmd and then it would be activated and you would then place the extra switch on the command to do something else)
Thanks anyway,
Rileyh
Thank you for that. Out of interest, what is the "~" supposed to do?
I didn't mean for the switch to be called, moreso as an "extra command" (you would type it into cmd and then it would be activated and you would then place the extra switch on the command to do something else)
Thanks anyway,
Rileyh