Quick starting guide
Starting with Dos9
Firstly, if you have never used
cmd or an equivalent
interpreter before, you should definitely consider reading a
tutorial about batch programming.
If you are already familiar with batch, just open
start typing some commands ! Dos9 batch dialect is almost
If you use Dos9 on windows, the only file extension provided
.dos9 by default (to avoid polluting your OS with potential
Once installed, it is quite straightforward to play with Dos9, especially if you are quite familiar with cmd. However, there is a couple of thing out there you have to know about.
On one hand, there is a couple of differences between Dos9 and cmd :
helpsystem is different from the original cmd help system. To be viewed, you need to create all manual pages using
help /bon the first time you run the command. Then, every command help can be accessed through the traditional
- The way operators and IF command are processed is a bit
IFdoes not automatically swallow more than commands on the right end side. For example
if 1==1 command1 & command2is not the same as
if 1==1 (comand1 & command2).
- There is a few
- Empty line are processed by
FOR /F. This behaviour can be disabled using
- Multiples lines can be used as input for
tokensspecified can be in reverse order and can also overlap without bug.
- Empty line are processed by
- Creating local environments via
SETLOCALis not supported yet.
- Some undocumented but useful variables from
cmdare still lacking (the most useful of theses is probably
- Dos9 has no inconsistencies with escaped characters with
^only require one escape.
DIR /bdoes not automatically return absolute paths.
On the other hand, Dos9 also provides you with with a bunch of extensions:
- A full set of extensions to support floating points arithmetics
The ground-breaking possibility to specify logical expressions using
ORand the new
IFextensions, like in the following example:
IF [ [ !ok! EQU 1 ] and [ defined file ] ] ( :: some code )
- To speed up parsing, Dos9 loads files entirely in memory at startup.
If the file gets modified during execution, it is reloaded and Dos9
restarts on the next lines (counting lines from the begining. This can
be disabled using
- As can be seen in the previous code,
::-style comments can be used inside blocks.
- All the
FORmodifications described above.
- Enhanced GOTO and CALL that can use a file and a label at the same
time and ignore errors:
GOTO :mylabel myfile.bat /Q CALL /e :mylabel myfile
- Extended HELP providing search capabilities and help in various formats including HELP.
- The new command ALIAS allowing to set up easy and fast aliases for the
ALIAS dbs=dir /b /s
echo match my regular expression | FIND /e "match * regular expression"
FIND` andMORE` commands are provided as internal commands.
XARGSruns a command taking command parameters on the standard input.
WCcounts line or words or bytes in a file.
:: Count lines in subdirs dir /s /b /a:-D . | xargs wc /l
New external command DUMP to dump hexadecimal code.
- New SHIFT extension and new
%+containing the remaining arguments.
Do you want more precise informations about Dos9 and its command ? Check out the online docs.