Copyright © 2003-2010 by Prof.
Last modified Sat 17-Apr-2010 15:15:36
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
This page is edited from the 1cmdfaq.txt faq-file contained in
command line interface (CLI) collection. That zipped file has much
additional material, including a number of detached .cmd script
files. It is recommended that you also get the zipped version as a
Please see "The Description and
the Index page
" for the conditions of usage and other such
3} How can I customize the Command Prompt Window with script commands?
In fact the "cmd" method in the
is the basis for an answer to a similar
question "How can I customize the Command Prompt window with script
commands?". The answer is that you first give all the commands you
want, then conclude with "cmd
naturally prepare a desktop icon to point to your script so that you
can open the window you have customized. Below is one example.
echo ^| CMDBOX.CMD CLI box by Prof. Timo Salmi ^|
echo ^| Last updated Sat 15-November-2003 ^|
:: Check about the Windows version
if [%OS%]==[Windows_NT] goto _doit
echo This script is for Windows NT/2000/XP/.. only.
echo Or have you tampered with the predefined variables?
:: Augment the Windows path (customize as appropriate) and show
:: Select the fastest keyboard repeat-rate,
mode con: rate=32 delay=1
:: Select the code page Multilingual Latin 1
mode con: codepage select=850
:: Choose (e.g.) blue background and bright white foreground
:: Make a home folder and go there
if not exist c:\_h mkdir c:\_h
echo cd c:\_h
:: Tag that we are in the Command Prompt Windows so that,
:: if need be, scripts can be made aware if they are being
:: called in the window instead a direct call from an icon
:: Finally, start "a new instance of the command interpreter"
:: The exit in case something went wrong
The shortcut to a script like similar to the ideas above would
display something like the following:
If you just want to skip all that output, redirect to nul. For
mode con: codepage select=850 >nul
To suppress the "Microsoft Windows" announcement, add switch /k to
the command interpreter calling line: