Windows Command Prompt Tutorial
Introduction Internal and External commands Basic Commands Basic file commands Sorting the data Searching patterns in file Comparing files Variables in Windows command prompt Piping Input and Output Redirection View all processes and tasks killing tasks scheduling tasks Network commands System hardware commandsVariables 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!!