Variables in windows command prompt

There are 2 types of variables.
  • User defined
  • Environment variables

Creating user defined variables

We can create new variables using set command.
 
set <variable-name>=<value>

set browser=chrome

To display the value of variable, you can use below command.
 
echo %<variable-name>%

For example – to view the variable “browser”, you can use below syntax.
 
echo %browser%

Viewing all environment variables

You can use “set” command to view all environment variables in Windows Command Prompt. Note that set command will shows user defined variables as well. Some of the important environment variables are given below.
  • %PATH%
  • %WINDIR%
  • %OS%
  • %USERNAME%
  • %COMPUTERNAME%

Web development and Automation testing

solutions delivered!!