General discussion
May 26, 2004 at 07:51 AM
jesper

Make Windows PROMPT you for a variable?

by jesper . Updated 22 years, 6 months ago

Hopefully I’ll be able to explain my question properly…

SCENARIO:

I have a batch file, lets call it RUNME.BAT that contains a %1 variable. Let’s say it reads as follows:

ECHO %1 is the greatest!

Typing it from the command line poses no problem obviously. Simply enter RUNME JESPER and the batch file will echo “JESPER is the greatest!”

However, what I want to do is make a shortcut on my desktop, pointing to this batch file. I still want to be able to send it any variable I choose, at the time of running.

In Windows 9x, this was VERY simple. You would edit the properties of the shortcut, and put a ? at the end of the command line. When you would run the shortcut, a window would pop up, asking you what the variable was. I believe you could do multiple question marks, for multiple variables.

No such luck in Windows 2000, and my searching for the answer has proven futile. I think the problem may be that I don’t know the proper terms to search for.

Anyways, I hope that one of you wonderful people will have the answer that I long for.

Have a nice day, folks.

This discussion is locked

All Comments