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

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 parameters

Reply to Message Icon

Name: Thomas Kluck
Date: December 7, 2000 at 12:52:49 Pacific
Comment:

I want to pass parameters from command line to a batch file. how can i do this? Anyone got some reference to online books on DOS?



Sponsored Link
Ads by Google

Response Number 1
Name: joe
Date: December 7, 2000 at 14:05:19 Pacific
Reply:

This is from vague memory.. any parameters passed to a batch file will be in the variables %1 thru %9

Example:

----------------
@echo off
echo.
echo ** SCAN.exe Batch File **
@echo on
scan.exe %1 %2 %3 %4 %5
----------------

Say the above file is called SCANALL.BAT and you call it using:

C:\>SCANALL /SUB /NOMEM

The parameter /SUB will be held in "%1" and /NOMEM is in "%2". It doesn't matter if there's nothing to go in "%3" to "%5" as they will just be null.


0

Response Number 2
Name: Michael
Date: December 8, 2000 at 08:36:13 Pacific
Reply:

Yeah! What Joe said! Right on the $!

-Michael


0

Response Number 3
Name: Laurence
Date: December 9, 2000 at 02:22:51 Pacific
Reply:
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 parameters

Passing Parameters between multiple batch files www.computing.net/answers/dos/passing-parameters-between-multiple-batch-files/776.html

Batch file - using %1 www.computing.net/answers/dos/batch-file-using-1/12462.html

batch file www.computing.net/answers/dos/batch-file/11146.html