Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Shortcut Running DOS Batch with "?"

Status
Not open for further replies.

taysys

Programmer
Dec 7, 2001
41
US
I am having a problem running a DOS batch file which requires a "?" on the command line to prompt the user for input. It runs fine from Start | Run, but when I create a shortcut with the "?" it assumes the "?" as a parameter instead of forcing a user prompt.

Any thought greatly appreciated.

Bob Taylor
 
Gabe036,

Thanks for the reply, but it still tries to interperet the ""?"" or "?" or ? as the first parameter in the command line ie. %1 I need it to prompt the user for input... thanks though.

BT
 
Maybe this sequence of commands will work :
@ECHO OFF
@ECHO Please enter the parameter :
the command line
 
Why not change the prompt to "WHAT IS THE PARAMETER?"?

Add a line to your batch file which reads:

SET PROMPT=WHAT IS THE PARAMETER?

 
Thanks for the replys, but maybe my question is too vague.

In the good ole days of DOS batch files (which still worked under NT4), if you ran a batch follwed by a question mark (?), the user would be prompted for input. Some batches I am using for automatically switching to a specific directory are set to accept the %1 command line paramter to change directory ie. cd\%1. So when I respond to the prompt window with "MyDir", the command translates to cd\MyDir.

Some batches require two parameters, %1 and %2. So, when propmted, I would enter "OldDir NewDir" and the batch would translate my input accordingly.

Anyway, with Win2k the batch command line does not recognize the ? as need to prompt the user for coammand line input, but actually accepts the ? as %1.. which is not correct.

If it's no longer possible from a shortcut, then I'll have to just use a command prompt and type it in.

Thanks. BT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top