Windows Batch Tutorial
Introduction First batch program Special characters in Batch programming Accepting user input Operators in Batch scripting Working with variables Integer operations Floating point operations Conditional Statements Looping statements goto statement Writing functions Passing arguments Returning exit codeAccept user input in windows batch
Now let us see how to accept the input from the user in batch file. Create one batch file with below code.
@echo off
set /P name=Enter your name
echo Your name is %name%
After you execute above code, it will ask you for your name. Once you enter your name and press “enter” key, your name will be displayed back on the screen. Note that /P stands for user input. name is a variable in which your name is stored using “set” command.Web development and Automation testing
solutions delivered!!