Prompt for Variable in Batch File

Vote Down
Score
2
Vote Up
April 1, 2005 at 07:35:34 Pacific
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



Reply ↓  Report •


#1
Vote Down
Score
32
Vote Up
April 1, 2005 at 07:53:03 Pacific

Hi
This help works in WinXp

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

echo "Password"
set /p PassWord=

echo %UserName% %PassWord%


Reply ↓  Report •

#2
Vote Down
Score
7
Vote Up
April 1, 2005 at 07:57:21 Pacific

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

Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« c++ integer into two Checkbox setting »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC