Tutorial - Basic Commands for Command Prompt/Batch Scripts

preview_player
Показать описание
I hope you enjoy the video! Please feel free to comment, rate, and subscribe.

Color codes:
0 = Black
8 = Gray
1 = Blue
9 = Light Blue
2 = Green
A = Light Green
3 = Aqua
B = Light Aqua
4 = Red
C = Light Red
5 = Purple
D = Light Purple
6 = Yellow
E = Light Yellow
7 = White
F = Bright White

Intro music by Approaching Nirvana
Song: Death of a King
Рекомендации по теме
Комментарии
Автор

3:40 oh lol, the point of my interest - how to change it back to default

yash
Автор

The reason why "start youtube.com" does not work is because it is looking for a program in the path/ current directory called "youtube.com"

hensola
Автор

hi, one questtion, i want to run `systeminfo` from run dialog, and pause/hold the screen ('cz otherwise it automatically exits). can u share how to do that?

yash
Автор

The @ in @echo does not matter in cmd but means somthing in batchpreform

jenniferblair
Автор

Bro can you make a full tutorial for cmd for making games

raventechyt
Автор

A quick method to prototype a script is the following:
(.cmd works the same as .bat)


c:\users\> copy con hello.cmd
c:\users\> @echo off
c:\users\> cls
c:\users\> setlocal
c:\users\> title Hello World
c:\users\> echo.
c:\users\> echo Please enter your name:
c:\users\> set /p NAME=
c:\users\> echo.
c:\users\> echo Hello %NAME%, how are you today?
c:\users\> echo.
c:\users\> title FIN!
c:\users\> endlocal
c:\users\> ^Z


Some points of note:
1) setlocal is used to ensure the variables you use are only active for the script you write only - this is very handy as you don't want to be overwriting any system or profile variables
For the example above, NAME is a variable which will contain whatever you type in.
It requires that you press ENTER to proceed with the script

2) echo. returns a blank line, useful for spacing out text outputs

3) Holding down the Ctrl key and tapping Z, and then pressing Enter will save the file called hello.cmd

4) Title FIN! is handy to know that the script has finished.. otherwise the DOS window will always say "Hello World" until such time as you modify the script, or close the DOS window

5) endlocal is used to close the setlocal, otherwise

You then display the listing of the hello.cmd script by typing either:
c:\users\> type hello.cmd

or
c:\users\> notepad hello.cmd

The script should look like this:

@echo off
cls
setlocal
title Hello World
echo.
echo Please enter your name:
set /p NAME=
echo.
echo Hello %NAME%, how are you today?
echo.
title FIN!
endlocal

hensola
visit shbcf.ru