

Like any programming language, DOS batch enables to reading of command-line arguments using %1, %2, etc. How to read command line parameters in DOS batch programming? Here is an example to sum the numbers and print the result to the command line. A option in the SET command allows you to treat the variable to store numeric values. How to read and store numeric numbers in a variables batch programming? The output of the above code is Please enter your name: john

p option to set a command, stop its execution and wait for the user to type the stringĪnd read the value and store it in a variable. How to prompt to read the value from the command line and store it in a variable Here is an example of declaring and using the variable with the set command off The variable value is an echo to the command line. Once a variable is declared, you can use the variable with %variable% syntax.


There are two ways to declare and store the values in variables. Here is a list of basic commands that you can use in a DOS prompt (e.g.How to Use Links in HTML - Internal and External linking in HTML Tutorial 7 Note: In MS-Dos, there is also a help page that opens up once 'type /?' is inserted after the command and this gives additional information about the command. In this article, we provide you with some basic MS-Dos commands to get you started. In effect, they create a convenient user interface. In the MS-Dos operating system, standard system commands are used to carry out various tasks like deleting specific files, changing the directory, listing contents of the specified directory, etc.
