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.
Use switches on batch file
Name: nmv (by AP81) Date: February 22, 2006 at 16:57:53 Pacific OS: Dos 7 CPU/Ram: 3200XP/1G
Comment:
I would like to assign switches to a batch file. I am asking here because I haven't been able to find much on the net, and the information that I have found is not detailed enough.
For example, I have a file called backup.bat (or backup.com after converting it to a .com file) I want to be able to issue the commands:
backup /check backup /verbose
What do I need to do in my batch file (or converted com file) to enable these switches?
Name: jboy Date: February 22, 2006 at 18:11:43 Pacific
Reply:
Batch files don't generally work with switches - unless you use replaceable parameters (%1 %2 etc), or else use the actual command & parameter, within the batch
Science is built up with facts, as a house is with stones. But a collection of facts is not more a science than a heap of stones is a home
0
Response Number 2
Name: KasMage15 Date: February 24, 2006 at 09:51:11 Pacific
Reply:
Start the program out something like this:
@ECHO OFF IF "%1" == "/?" GOTO HELP IF "%1" == "/C" GOTO COPY
Then keep it going. %2 is the second parameter, %3 is the third parameter, etc. But this is usually only good if only one parameter is loaded at a time. If you have a program that loads multiple parameters (ex. SCANDISK /AUTOFIX /SURFACE) it will be hard to get it to work.
Summary: Hi, I need to compile 18 VB programs daily so I want to do it using a batch file so I don't have to do one by one. It seems like memory gets saturated because DOS wants to do them all at once...what c...
Summary: What do you mean by "I got it to work in Win NT only.." ? You mean you've already done that task on WinNT, and need the batch file to Win9x, or you need the batch only for WinNT? I think that in WinNT...