Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Batch: Read input from user

‘set /p variable=[prompt string]’ used to read Input from user. It prompts the user with given prompt string and assign the user entered value to the variable.

@echo off

set /p firstName=Enter first name
set /p lastName=Enter last name

echo Hello Mr %firstName% %lastName%

Enter first name Krishna
Enter last name Gurram
Hello Mr Krishna Gurram

You can rewrite the above application using string concatenation like below.

This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Batch: Read input from user


Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription