Computing.Net > Forums > Programming > Prompt for Variable in Batch File

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Prompt for Variable in Batch File

Reply to Message Icon

Name: tolksee
Date: April 1, 2005 at 07:35:34 Pacific
OS: Win2k, NT
CPU/Ram: P4 / 512
Comment:

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




Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: April 1, 2005 at 07:53:03 Pacific
Reply:

Hi
This help works in WinXp

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

echo "Password"
set /p PassWord=

echo %UserName% %PassWord%


0

Response Number 2
Name: tolksee
Date: April 1, 2005 at 07:57:21 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Prompt for Variable in Batch File

Variables in Batch Files www.computing.net/answers/programming/variables-in-batch-files/14347.html

Nesting variables in batch files ? www.computing.net/answers/programming/nesting-variables-in-batch-files-/14334.html

Date Routines in Batch Files www.computing.net/answers/programming/date-routines-in-batch-files/15590.html