Articles

Prompt for Variable in Batch File

April 1, 2005 at 07:35:34
Specs: Win2k, NT, P4 / 512

Hi,

I have a batch file that runs a command with parameters. The batch file contains just one line - EG:

program.exe -uUsername -pPassword -cConnection

I would like to have the user prompted to enter thier username and passoword when they run the batch file, rather than have a USername & PAssword hard-coded in the batch file. How can I do this?

Thanks for your help!

Lee



See More: Prompt for Variable in Batch File

Report •


#1
April 1, 2005 at 07:53:03

Hi
This help works in WinXp

@echo off
echo "Enter Username"
set /p UserName=

echo "Password"
set /p PassWord=

echo %UserName% %PassWord%


Report •

#2
April 1, 2005 at 07:57:21

Excelent, works a treat!! Thanks for the reply.

Report •

Related Solutions


Ask Question