How to create a Dos batch file parameter

How to create a doc batch file with parameter.
Bharat GuruAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
Pretty easy to do, here is an example BAT script:
@echo off
echo Parm was: "$~1"

Open in new window


Then run from a command line (or call from another batch file like this:

call mybatch.bat "Hello world"

~bp

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnBusiness Consultant (Owner)Commented:
You need a bit of a program to accept the input for the batch file to process. Here is an example from a Microsoft  Support article.

https://support.microsoft.com/en-us/kb/77457

I have used something similar many years ago.
Steve KnightIT ConsultancyCommented:
John... if that is what he means I think you'll find that won't work on a modern OS being a COM file, certainly not 64 bit ones.

Can use

set /p input=Enter something:
echo %input%

or slightly more complicated ways such as making a GUI inputbox with VBScript or external util, e.g
http://scripts.dragon-it.co.uk/links/batch-gui-inputbox
http://scripts.dragon-it.co.uk/links/batch-gui-yesno-messagebox

But as to what is actually wanted we will have to see what Bharat Guru comes back with I guess.

Steve
Bharat GuruAuthor Commented:
thx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.