[ About | Licence | Contacts ]
Written by Oleksandr Gavenko (AKA gavenkoa), compiled on 2018-02-10 from rev 9e6ad6607a9e.

CMD Windows shell.

Quoting.

http://msdn.microsoft.com/en-us/library/ms880421.aspx
Parsing C Command-Line Arguments

Variables.

Variable name start with letter and underscore, next chars can be letter, number and underscore. Variable name is case insensitive.

List of variables.

cmd> set
...
VAR=VALUE

Getting.

Write %VAR% in place where you want insert variable VAr value.

Setting.

cmd> set /p VAR=VALUE

Deleting.

cmd> set VAR=

Input from user.

cmd> set /p VAR=PROMPT

VAR is variable name, PROMPT is displayed prompt.

Input from file.

cmd> set /p VAR=<FILE

VAR is variable name, FILE is file name. Sfter executing VAR contain first line from FILE.

CMD tricks.

$ set /p TOOLOUTPUT= < temp.txt

$ for /f "tokens=*" %%i in ('%~dp0sometool.exe') do set TOOLOUTPUT=%%i

$ for /f "tokens=1 delims=" %%s in (users.txt) do (echo %%S & command "%%S") >> outputfile.txt

Resize cmd window.

cmd# mode CON: COLS=120 LINES=40

Limits.

Variable value and one line command string after expansion can not exceed 8191 characters for Windows XP and later and 2047 for Windows NT, Windows 2000.

http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
Command prompt (Cmd. exe) command-line string limitation.

How run cmd on 64-bit OS.

From 64-bit process:

%windir%\System32\cmd.exe (for 64-bit)
%windir%\SysWOW64\cmd.exe (for 32-bit)

From 32-bit process:

%windir%\System32\cmd.exe (for 32-bit)
%windir%\Sysnative\cmd.exe (for 64-bit)
http://msdn.microsoft.com/en-us/library/aa384187%28VS.85%29.aspx
File System Redirector