Computing.Net > Forums > Disk Operating System > Batch file Switches

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file Switches

Reply to Message Icon

Name: jezza
Date: February 3, 2004 at 06:02:18 Pacific
OS: xp/win2k3
CPU/Ram: +2500, 1GB RAM
Comment:

Hey,
Is it possible to add switches to a batch file?

For example "name.bat /install" & "name.bat /uninstall"

Thanks
jezza



Sponsored Link
Ads by Google

Response Number 1
Name: JackG
Date: February 3, 2004 at 07:57:25 Pacific
Reply:

You pass parameters on the command line to a batch file, and there is no reason you can not call them "switches" that you check for. You just have to check the parameters for the whole "switch" just like you would check for any parameter passed.


0

Response Number 2
Name: Wengier
Date: February 3, 2004 at 13:26:50 Pacific
Reply:

If you add a "switch" to a batch file, then the "switch" will become the standard replaceable parameter of the batch, namely %1, %2, etc.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch file Switches

Use switches on batch file www.computing.net/answers/dos/use-switches-on-batch-file/16063.html

Choice in batch files on NT4-DOS www.computing.net/answers/dos/choice-in-batch-files-on-nt4dos/11474.html

Dos Commands in a batch file www.computing.net/answers/dos/dos-commands-in-a-batch-file/1258.html