For a lot of lines batch cell is set to none or is empty (or incomplete) though there are ways the limitations to be worked around with hacks/functions and etc.
And I'm not handy with markdown formatting so I suppose you should also read this as plain text also.
0.version - ver command - will print the version of windows. Also %CMDEXTVERSION% variable prints the version of the command prompt which hasn't been changed since windows 2000
1.getting CPU usage - in batch script use double % :
typeperf "\Processor(_Total)% Processor Time" -sc 1
2.List all variables
set " -> this will list more variables (though is rather a hack)
there's a hack that allows you to call a function from another batch: http://stackoverflow.com/a/30170342/388389
environment variables are imported to the cmd and they can be accessed with %variable% -or- with delayed expansion !variable!
5.Getting the username:
doskey ls=dir /b . though doskey macros cannot be used in batch file
for %%a in ("cmd.exe") do @echo %%~f$PATH:a
9.there are lot of ways to start a background process but requires a more complicated function script
10.suspend should be ctrl+c
taskkill /im cmd* /f
16.is readable, is writeable, is executable
attrib command should be used here - http://ss64.com/nt/attrib.html
for %%# in ("somefile") do echo %%~z#
for /f "useback tokens=* delims=" %%# in ("c:\somefile.txt") do (
19.write file to stdout
despite there's a bug in FOR /L and breaking does not work so good with large numbers - http://www.dostips.com/forum/viewtopic.php?f=3&t=5778
but for other FOR loops will work
for /l %%# in (1;1;10) do (
if %%# equ 5 (
scope can be limited with ENDLOCAL and SETLOCAL commands - http://ss64.com/nt/setlocal.html
22.Anonymous functions are possible with a hacks...
one of them are the macros - http://ss64.com/nt/syntax-macros.html
the other way is to abuse one bug in CALL function - this one is more close to the anonymous function definition https://github.com/npocmaka/batch.scripts/blob/master/discovers_and_bugs/discovers/anonymous.bat
if %string1% equ %string2% echo strings are identical
for /l %%# in (1 , 1 , 80 ) do (
for %%# in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set string=!string:%%#=%%#!
for %%# in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do set string=!string:%%#=%%#!