Windows Batch TutorialIntroduction 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 code
Accept user input in windows batchNow let us see how to accept the input from the user in batch file. Create one batch file with below code.
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.
@echo off set /P name=Enter your name echo Your name is %name%
Web development and Automation testing