Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ColorDemo.cmd: Coloring the Console

171 views
Skip to first unread message

Frank

unread,
Nov 2, 2007, 10:02:45 AM11/2/07
to
I found a way to print color without third party programs. The
explanation is in the demo script below.

This script creates and deletes several small files in the %TEMP%
directory. I normally avoid writing to disk but this time I couldn't.

Frank

:: COLORDEMO.CMD ::::::::::::::::
@Echo OFF
SetLocal
If NOT DEFINED %0 (
Set "%0=1"
Start CMD /k%0
Goto :EOF
)
MODE CON: COLS=80 LINES=59
::CLS
Title. Coloring The
Console
Set "Color.A="
Set "Color.B= Coloring The Console"
Set "Color.C="
Call :ColorPrint 0F

Echo. A Demonstration

Set "Color.B= Frank P. Westlake, 2007"
Call :ColorPrint 06
Echo.
Echo.

Set "Color.B=GENERAL"
Call :ColorPrint 0B

Set "Wrap=FINDSTR and SET/P can be used to print text in a selected"
Set "Wrap=%Wrap% color and in the default color both on the same
line."
Set "Wrap=%Wrap% For example:"
Call :Wrap
Set "Wrap="
Echo.

Set "Color.A= Optional text, "
Set "Color.B=color text"
Set "Color.C=, optional text."
Call :ColorPrint 0D
Echo.

Set "Wrap=But because of the nasty colon this technique is probably"
Set "Wrap=%Wrap% only useful when a colon is useful, such as the"
Set "Wrap=%Wrap% following:"
Call :Wrap
Set "Wrap="

Echo.
Set "Color.A="
Set "Color.B= Enabled"
Set "Color.C= Wireless network interface."
Call :ColorPrint 0A

Set "Color.B= Disabled"
Set "Color.C= LAN interface."
Call :ColorPrint 0C
Echo.

Set "Color.A="
Set "Color.B=PROCEDURE"
Set "Color.C="
Call :ColorPrint 0B

Set "Wrap=The programmer sets text into one, two, or three variables
as"
Set "Wrap=%Wrap% follows:"
Call :Wrap
Echo.
Set "Color.B= VARIABLE CONTENTS"
Call :ColorPrint 0B
Set "Wrap.Hang= "
Set "Wrap= Color.A Optional text to be printed in the default
color"
Set "Wrap=%Wrap% preceding the color text."
Call :Wrap
Set "Wrap= Color.B Text to be printed in a selected color."
Call :Wrap
Set "Wrap= Color.C Optional text to be printed in the default
color"
Set "Wrap=%Wrap% following the color text."
Call :Wrap
Set "Wrap.Hang="
Echo.
Set "Wrap=The programmer then calls the :ColorPrint routine with a"
Set "Wrap=%Wrap% color value. For example:"
Call :Wrap
Set "Wrap="
Echo.
Set Wrap= Set "Color.A= Optional text, "
Call :Wrap
Set Wrap= Set "Color.B=color text"
Call :Wrap
Set Wrap= Set "Color.C=, optional text."
Call :Wrap
Set "Wrap= Call :ColorPrint 0D"
Call :Wrap
Echo.
Echo.The output:
Echo.
Set "Color.A= Optional text, "
Set "Color.B=color text"
Set "Color.C=, optional text."
Call :ColorPrint 0D
Echo.

Set "Wrap=The :ColorPrint routine creates a subdirectory in %%TEMP%%"
Set "Wrap=%Wrap% with the name of this script. This is so that there"
Set "Wrap=%Wrap% will be only one file in the directory. Then a file"
Set "Wrap=%Wrap% is created in that directory with it's name being
the"
Set "Wrap=%Wrap% string in the variable Color.B. The file is written"
Set "Wrap=%Wrap% with the contents of the variable Color.C, or only a"
Set "Wrap=%Wrap% newline if that variable is undefined. SET/P is used"
Set "Wrap=%Wrap% to print Color.A without a newline, then FINDSTR is"
Set "Wrap=%Wrap% called to search the file for a line. FINDSTR prints"
Set "Wrap=%Wrap% the filename in the color specified in the CALL"
Set "Wrap=%Wrap% statement, then the contents of the file in the"
Set "Wrap=%Wrap% default color. The file and subdirectory are then
both"
Set "Wrap=%Wrap% deleted."
Call :Wrap
Set "Wrap="
Echo.

Set "Wrap=One undesirable attribute of this technique is that it"
Set "Wrap=%Wrap% writes a file each time the print routine is called."
Call :Wrap
Set "Wrap="
Echo.
Call :Wrap The following characters may not be used in color strings:
Set Invalid="\|*/?:"
Set Invalid
Echo.
Set "Wrap=Experienced CMD script programmers might prefer to call"
Set "Wrap=%Wrap% SET/P and FINDSTR directly as needed."
Call :Wrap
Set "Wrap="
Set "Color.A="
Set "Color.B=Press any key to continue"
Set "Color.C="
Call :ColorPrint CF
PAUSE>NUL:
Exit
Goto :EOF


::::::::::::::::::::::::::::::::::::::::::::::::::ColorPrint
::ColorPrint ColorValue
Prints lines in the color specified on the command line with a nasty
colon.

INPUT VARIABLES:
Color.A First portion of line printed without color.
May be undefined.
Color.A Middle portion of line printed with the color specified
on the command line. Must be defined.
Color.C Final portion of line printed without color.
May be undefined.
CHARACTERS:
Valid: 0-9 A-Z a-z `~!@#^$%&()-_+=[]{};',
Invalid: \|*/?:

EXAMPLE:
Set "Color.A="
Set "Color.B=Enabled"
Set "Color.C= Wireless network interface."
Call :ColorPrint 0A

:ColorPrint
MD %Temp%\%~n0
Pushd %Temp%\%~n0
Echo.%Color.C%>"%Color.B%"
Set /P =%Color.A%<NUL:
FindStr /A:%1 /R "^" "%Color.B%*"
Popd
RD /S /Q %Temp%\%~n0
Goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::Wrap
::Wrap
Reads text on the command line and performs word wrap printing to
STDOUT.

Do NOT use tab characters. A tab is a single character when
determining
line length but it could be up to eight columns when printing; which
might destroy the wordwrap feature for that line.

INPUT VARIABLES:
Wrap Read if there is no text on the command line. Use this
variable instead of the command line when leading spaces
or special characters need to be preserved. Escape
special characters with '^'. For example:

Call :Wrap Pipe COMMAND1 to COMMAND2 using the
syntax:
SET "Wrap= COMMAND1 ^| COMMAND2"
Call :Wrap

Wrap.Indent Set this variable with the amount of spaces necessary
to indent each paragraph. Indent is first line only. For
example:

Set "Wrap.Indent= "
Call :Wrap Two leading spaces.

Wrap.Hang Set this variable with amount of spaces necessary to
indent the paragraph after the first line. For Example:

Set "Wrap.Hang= "
Call :Wrap Paragraph hang indented two spaces.

:Wrap
SetLocal
For /F "tokens=2" %%a in ('MODE^|Find "Columns"') Do (
Set /A Cols=%%a -2)
If "%*" NEQ "" Set "Wrap=%*"
If NOT DEFINED Wrap (
For /F "delims=" %%W in ('MORE') Do Call :Wrap %%W
Goto :EOF
)
Set "Wrap=%Wrap.Indent%%Wrap%"
:Wrap.Loop
CALL Set "prt=%%Wrap:~0,%cols%%%"
CALL Set "Test=%%Wrap:~%cols%%%"
Set /A i=cols
:Adjust
Set /A i=i-1
If NOT DEFINED TEST Goto :Print
If "%prt:~-1,1%" NEQ " " (
Set "prt=%prt:~0,-1%"
Goto :Adjust
)
Set /A i=i+1
:Print
CALL Set "Wrap=%%Wrap:~%i%%%"
Echo.%prt%
If DEFINED Wrap (
Set "Wrap=%Wrap.Hang%%Wrap%"
Goto :Wrap.Loop
)
EndLocal
Goto :EOF
:: END OF COLORDEMO.CMD :::::::::::::::::::::

foxidrive

unread,
Nov 2, 2007, 11:17:51 AM11/2/07
to
On Fri, 02 Nov 2007 07:02:45 -0700, Frank <fp.we...@yahoo.com> wrote:

>I found a way to print color without third party programs. The
>explanation is in the demo script below.

Plz post an unwrapped copy Frank.

Frank

unread,
Nov 2, 2007, 11:46:24 AM11/2/07
to

Echo. A Demonstration

Set "Wrap=%Wrap% line. For example:"

Set "Wrap=%Wrap% as follows:"


Call :Wrap
Echo.
Set "Color.B= VARIABLE CONTENTS"
Call :ColorPrint 0B
Set "Wrap.Hang= "
Set "Wrap= Color.A Optional text to be printed in the default"

Set "Wrap=%Wrap% color preceding the color text."


Call :Wrap
Set "Wrap= Color.B Text to be printed in a selected color."
Call :Wrap
Set "Wrap= Color.C Optional text to be printed in the default"

Set "Wrap=%Wrap% color following the color text."

Set "Wrap=%Wrap% the string in the variable Color.B. The file is"
Set "Wrap=%Wrap% written with the contents of the variable Color.C,
or"
Set "Wrap=%Wrap% only a newline if that variable is undefined. SET/P"
Set "Wrap=%Wrap% is used to print Color.A without a newline, then"
Set "Wrap=%Wrap% FINDSTR is called to search the file for a line."
Set "Wrap=%Wrap% FINDSTR prints the filename in the color specified"
Set "Wrap=%Wrap% in the CALL statement, then the contents of the file"
Set "Wrap=%Wrap% in the default color. The file and subdirectory are"
Set "Wrap=%Wrap% then both deleted."

Frank

unread,
Nov 2, 2007, 11:49:47 AM11/2/07
to

Echo. A Demonstration

Set "Wrap=%Wrap% or only a newline if that variable is undefined."
Set "Wrap=%Wrap% SET/P is used to print Color.A without a newline,"
Set "Wrap=%Wrap% then FINDSTR is called to search the file for a"
Set "Wrap=%Wrap% line. FINDSTR prints the filename in the color"
Set "Wrap=%Wrap% specified in the CALL statement, then the contents
of"
Set "Wrap=%Wrap% the file in the default color. The file and"
Set "Wrap=%Wrap% subdirectory are then both deleted."

Frank

unread,
Nov 2, 2007, 11:53:25 AM11/2/07
to
:: COLORDEMO.CMD ::::::::::::::::
@Echo OFF
SetLocal
If NOT DEFINED %0 (
Set "%0=1"
Start CMD /k%0
Goto :EOF
)
MODE CON: COLS=80 LINES=59
::CLS

Echo. A Demonstration

Set "Wrap=%Wrap% of the file in the default color. The file and"

Frank

unread,
Nov 2, 2007, 11:55:27 AM11/2/07
to
That one looks good. A 72 character line length limit is absurd.

Frank

foxidrive

unread,
Nov 2, 2007, 12:45:54 PM11/2/07
to
On Fri, 02 Nov 2007 08:53:25 -0700, Frank <fp.we...@yahoo.com> wrote:

>:: COLORDEMO.CMD

Nicely inventive, Frank. :)

Timo Salmi

unread,
Nov 3, 2007, 3:44:02 AM11/3/07
to
Frank <fp.we...@yahoo.com> wrote:
> I found a way to print color without third party programs. The
> explanation is in the demo script below.

Excellent. It always is good to have new ideas and thus alternative
solutions. We will recall, naturally, that this problem already has been
solved in a more concise way using XP's CONFIG.NT, as explained towards
the end of the FAQ item

51} How can I echo lines in different colors in NT scripts?
195399 May 17 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

But, indeed, the more, the merrier.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html

Frank

unread,
Nov 3, 2007, 9:45:01 AM11/3/07
to
On Nov 3, 12:44 am, Timo Salmi <t...@uwasa.fi> wrote:
> We will recall, naturally, that this problem already has been
> solved in a more concise way using XP's CONFIG.NT...

I believe that uses COMMAND.COM does it not? if so then it had not
been solved for CMD.EXE.

Frank

Timo Salmi

unread,
Nov 3, 2007, 9:53:55 AM11/3/07
to
Frank <> wrote:
> On Nov 3, 12:44 am, Timo Salmi <t...@uwasa.fi> wrote:
>> We will recall, naturally, that this problem already has been
>> solved in a more concise way using XP's CONFIG.NT...

> I believe that uses COMMAND.COM does it not?

No, that is not necessary.

> if so then it had not been solved for CMD.EXE.

It's been solved. The solution works well for CMD.EXE.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland

Useful script files and tricks ftp://garbo.uwasa.fi/pc/link/tscmd.zip

Clay Calvert

unread,
Nov 3, 2007, 9:41:48 PM11/3/07
to
On Fri, 02 Nov 2007 08:53:25 -0700, Frank <fp.we...@yahoo.com>
wrote:

Absolutely brilliant. Welcome back.

Clay Calvert
CCal...@Zanguru.com
Replace "Z" with "L"

Frank

unread,
Nov 5, 2007, 10:43:00 AM11/5/07
to
On Nov 3, 5:53 am, Timo Salmi <t...@uwasa.fi> wrote:
> Frank <> wrote:
> > On Nov 3, 12:44 am, Timo Salmi <t...@uwasa.fi> wrote:
> >> We will recall, naturally, that this problem already has been
> >> solved in a more concise way using XP's CONFIG.NT...

> It's been solved. The solution works well for CMD.EXE.

Then that is a good option if you have access to CONFIG.NT and wish to
go to the trouble.

Frank

Frank

unread,
Nov 5, 2007, 10:55:33 AM11/5/07
to
On Nov 3, 5:41 pm, Clay Calvert <ccalv...@Zanguru.com> wrote:
> On Fri, 02 Nov 2007 08:53:25 -0700, Frank <fp.westl...@yahoo.com>

> wrote:
>
> Absolutely brilliant. Welcome back.

It's only brilliant if you have the high intensity bit set (colors
8-16). Thanks Clay.

Since I have the floor I'll include a revision to this demo which uses
the idea I proposed in another thread. This script will print color
only if the user has the variable ConsoleTextColor defined and if the
necessary color variables are also defined. This script is better
because the previous required you to have a black background, This
script will use the user's choice, if defined. The following variables
should be defined for color:

ConsoleTextColor .Bold
ConsoleTextColor .Soft
ConsoleTextColor .Caption
ConsoleTextColor .Container
ConsoleTextColor .Enabled
ConsoleTextColor .Disabled
ConsoleTextColor .Highlight

They can be created manually (i.e. SET ConsoleTextColor .bold=0F) or
with the SetColorAttributes.cmd script in the other thread.

Frank
(I sure hope I got the line sizes right)

:: COLORDEMO.CMD ::::::::::::::::
@Echo OFF
SetLocal
If NOT DEFINED %0 (
Set "%0=1"
Start CMD /k%0
Goto :EOF
)
MODE CON: COLS=80 LINES=59

Title Coloring The Console


Set "Color.A="
Set "Color.B= Coloring The Console"
Set "Color.C="

Call :ColorPrint bold
Echo. A Demonstration

Set "Color.B= Frank P. Westlake, 2007"

Call :ColorPrint soft
Echo.
Echo.

Set "Color.B=GENERAL"
Call :ColorPrint caption

Set "Wrap=FINDSTR and SET/P can be used to print text in a selected"
Set "Wrap=%Wrap% color and in the default color both on the same"
Set "Wrap=%Wrap% line. For example:"
Call :Wrap
Set "Wrap="
Echo.

Set "Color.A= Optional text, "
Set "Color.B=color text"
Set "Color.C=, optional text."

Call :ColorPrint container
Echo.

Set "Wrap=But because of the nasty colon this technique is probably"
Set "Wrap=%Wrap% only useful when a colon is useful, such as the"
Set "Wrap=%Wrap% following:"
Call :Wrap
Set "Wrap="

Echo.
Set "Color.A="
Set "Color.B= Enabled"
Set "Color.C= Wireless network interface."

Call :ColorPrint enabled

Set "Color.B= Disabled"
Set "Color.C= LAN interface."

Call :ColorPrint disabled
Echo.

Set "Color.A="
Set "Color.B=PROCEDURE"
Set "Color.C="

Call :ColorPrint caption

Set "Wrap=The programmer sets text into one, two, or three variables"
Set "Wrap=%Wrap% as follows:"
Call :Wrap
Echo.
Set "Color.B= VARIABLE CONTENTS"

Call :ColorPrint caption


Set "Wrap.Hang= "
Set "Wrap= Color.A Optional text to be printed in the default"
Set "Wrap=%Wrap% color preceding the color text."
Call :Wrap
Set "Wrap= Color.B Text to be printed in a selected color."
Call :Wrap
Set "Wrap= Color.C Optional text to be printed in the default"
Set "Wrap=%Wrap% color following the color text."
Call :Wrap
Set "Wrap.Hang="
Echo.
Set "Wrap=The programmer then calls the :ColorPrint routine with a"
Set "Wrap=%Wrap% color value. For example:"
Call :Wrap
Set "Wrap="
Echo.
Set Wrap= Set "Color.A= Optional text, "
Call :Wrap
Set Wrap= Set "Color.B=color text"
Call :Wrap
Set Wrap= Set "Color.C=, optional text."
Call :Wrap

Set "Wrap= Call :ColorPrint container"


Call :Wrap
Echo.
Echo.The output:
Echo.
Set "Color.A= Optional text, "
Set "Color.B=color text"
Set "Color.C=, optional text."

Call :ColorPrint container
Echo.

Call :ColorPrint highlight


PAUSE>NUL:
Exit
Goto :EOF


::::::::::::::::::::::::::::::::::::::::::::::::::ColorPrint
::ColorPrint ColorValueName
Prints lines in a color specified in the environment. The environment
variable name is composed of the following:

ConsoleTextColor.%1

where %1 is the remainder of the variable's name on the command line.
Suggested variables are:

ConsoleTextColor.Bold
ConsoleTextColor.Caption
ConsoleTextColor.Container
ConsoleTextColor.Disabled
ConsoleTextColor.Enabled
ConsoleTextColor.Error
ConsoleTextColor.Highlight
ConsoleTextColor.Normal
ConsoleTextColor.Soft

See SetColorAttributes.cmd for details.

INPUT VARIABLES:
Color.A First portion of line printed without color.
May be undefined.
Color.A Middle portion of line printed with the color specified
on the command line. Must be defined.
Color.C Final portion of line printed without color.
May be undefined.
CHARACTERS:
Valid: 0-9 A-Z a-z `~!@#^$%&()-_+=[]{};',
Invalid: \|*/?:

EXAMPLE:
Set "Color.A="
Set "Color.B=Enabled"
Set "Color.C= Wireless network interface."

Call :ColorPrint enabled

:ColorPrint
SetLocal ENABLEDELAYEDEXPANSION
If NOT DEFINED ConsoleTextColor (
Echo.%Color.A%%Color.B%%Color.C%
Goto :EOF
)
If NOT DEFINED ConsoleTextColor.%1 (
Echo.%Color.A%%Color.B%%Color.C%
Goto :EOF
)


MD %Temp%\%~n0
Pushd %Temp%\%~n0
Echo.%Color.C%>"%Color.B%"
Set /P =%Color.A%<NUL:

Set Color.Value=!ConsoleTextColor.%1!
FindStr /A:%Color.Value% /R "^" "%Color.B%*"


Popd
RD /S /Q %Temp%\%~n0

EndLocal

Frank

unread,
Nov 6, 2007, 9:48:45 AM11/6/07
to
"Timo Salmi" news:472c2646$0$3508$9b53...@news.fv.fi...

> We will recall, naturally, that this problem already has been
> solved in a more concise way using XP's CONFIG.NT, as explained
> towards the end of the FAQ item
>
> 51} How can I echo lines in different colors in NT scripts?
> 195399 May 17 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
> tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

All of those use COMMAND.COM Timo.

"Timo Salmi" news:472c7cf3$0$3499$9b53...@news.fv.fi...


> Frank <> wrote:
>> I believe that uses COMMAND.COM does it not?
>
> No, that is not necessary.

I think you may be confused Timo.


"Timo Salmi" news:472c7cf3$0$3499$9b53...@news.fv.fi...


> Frank <> wrote:
>> if so then it had not been solved for CMD.EXE.
>
> It's been solved. The solution works well for CMD.EXE.

So where is the solution which uses CMD.EXE but not COMMAND.COM Timo?
Does 64-bit Windows have COMMAND.COM Timo? Can it even run COMMAND.COM
Timo?

COMMAND.COM does not work well with CMD.EXE as others have tried to
explain to you.

Frank

Timo Salmi

unread,
Nov 6, 2007, 10:20:28 AM11/6/07
to
Frank <fp.we...@yahoo.com> wrote:
> "Timo Salmi"
>> We will recall, naturally, that this problem already has been
>> solved in a more concise way using XP's CONFIG.NT, as explained
>> towards the end of the FAQ item
>>
>> 51} How can I echo lines in different colors in NT scripts?
>> 195399 May 17 2007 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
>> tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi
>
> All of those use COMMAND.COM Timo.

No they most certainly don't.

> "Timo Salmi" news:472c7cf3$0$3499$9b53...@news.fv.fi...
>> Frank <> wrote:
>>> I believe that uses COMMAND.COM does it not?
>> No, that is not necessary.
>
> I think you may be confused Timo.

Yes, in a sense. As to why you are imparting false information
about my FAQ material.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland

Frank

unread,
Nov 6, 2007, 10:59:48 AM11/6/07
to
"Timo Salmi" news:4730863f$0$3207$9b53...@news.fv.fi...

> Yes, in a sense. As to why you are imparting false information
> about my FAQ material.

I'll quote the relevant lines. Perhaps you can explain how "command/
cecho" is not a call to COMMAND.COM.

Line 4951:
command /cecho [0;40;36;1mThis should appear in cyan
[0;40;31;1mand this in red
Line 4968:
command /cecho TheAnsiSequence + WhateverText
Line 4973:
set cecho_=command /cecho
Line 4988:
set cecho=command /cecho

Frank

Timo Salmi

unread,
Nov 6, 2007, 3:49:42 PM11/6/07
to
Frank <fp.we...@yahoo.com> wrote:
> "Timo Salmi"
>> Yes, in a sense. As to why you are imparting false information
>> about my FAQ material.

> I'll quote the relevant lines. Perhaps you can explain how "command/
> cecho" is not a call to COMMAND.COM.
>
> Line 4951:
> command /cecho [0;40;36;1mThis should appear in cyan

Ok, fair enough, so let me rephrase, if we wish to split hairs. The
trick works in a CMD.EXE window and context. Invoking a single line for
color within the a CMD.EXE script utilizes COMMAND.COM, true. I readily
grant that. But it is in no way a limitation for the workings of the
complete a script. To demonstrate, consider one of the _full_ examples
in the very item you extracted the line from

@echo off & setlocal enableextensions enabledelayedexpansion
cls
set cecho_=command /cecho
for /l %%i in (0,1,7) do (
for /l %%j in (2,1,9) do (
set /a k=%%j-2
%cecho_% <ESC>[%%j;%%i1H<ESC>[4!k!;3%%im[4!k!;3%%i;1m
)
)
%cecho_% <ESC>[40;30;1mThe end of the demo by Prof. Timo Salmi
endlocal & goto :EOF

That entity is a fully working CMD.EXE script with no extra limitations.
It works, and it is fairly simple to use.

Incidentally, if one uses e.g. FINDSTR in a CMD.EXE script, also that
will call a separate command, namely C:\WINDOWS\system32\findstr.exe yet
we think nothing of that.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland

Digital photos collection at http://www.uwasa.fi/ktt/lasktoim/photo/

Matthias Tacke

unread,
Nov 6, 2007, 4:28:40 PM11/6/07
to
Timo Salmi wrote:
> That entity is a fully working CMD.EXE script with no extra limitations.
> It works, and it is fairly simple to use.
>
But there is no command.com and no support for 16 bit DOS apps in
64bit windows versions.
So Frank and you were talking about different things.

> Incidentally, if one uses e.g. FINDSTR in a CMD.EXE script, also that
> will call a separate command, namely C:\WINDOWS\system32\findstr.exe yet
> we think nothing of that.
>

Well, findstr is a 32bit console app and would be no problem in a 64bit
windows.

--
Greetings
Matthias

Timo Salmi

unread,
Nov 7, 2007, 12:02:06 AM11/7/07
to
Matthias Tacke <Matt...@Tacke.de> wrote:
> Timo Salmi wrote:
>> That entity is a fully working CMD.EXE script with no extra
>> limitations. It works, and it is fairly simple to use.

> But there is no command.com and no support for 16 bit DOS apps in
> 64bit windows versions. So Frank and you were talking about different
> things.

Right. The environment that
ftp://garbo.uwasa.fi/pc/link/tscmd.zip


Useful NT/2000/XP script tricks and tips, T.Salmi

best covers and is tested for is (currently) XP SP2.

I have no idea what happens on Vista. Nor do I make any claims for that
platform.

Anyway "the more (material and solutions), the merrier".

Explicitly:

Caveats
=======

The scripts in this FAQ have been tested on a Windows XP [Version
5.1.2600] SP1 system, which adds some new features to script
commands and their parameters. Mostly, no attempt has been or will
be made to identify which features might be novel compared to the
earlier (factual) NT versions. Thus there is no guarantee that all
the solutions are fully backwards or forwards compatible. The later
items have been processed with SP2 installed.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland

Clay Calvert

unread,
Nov 7, 2007, 10:06:02 PM11/7/07
to
On Wed, 07 Nov 2007 07:02:06 +0200, Timo Salmi <t...@uwasa.fi> wrote:

>Right. The environment that
> ftp://garbo.uwasa.fi/pc/link/tscmd.zip
> Useful NT/2000/XP script tricks and tips, T.Salmi
>best covers and is tested for is (currently) XP SP2.

Timo, it might be worthwhile to specify _which_ version of XP because
there are several, including a 64-bit version. Here are the versions
of XP.

- Home Edition
- Professional Edition
- Media Center Edition
- Tablet PC Edition
- Professional x64 Edition

There are command-line features missing in Home that exist in the
others, and as has been discussed, there are features not in the
64-bit version. Media Center and Tablet PC are both based of the
32-bit XP Pro.

Thanks

foxidrive

unread,
Nov 7, 2007, 11:47:47 PM11/7/07
to

I'm not sure one can be definitive, Clay. Various things are introduced and
fixed or changed in service packs and would be onerous to document which is
which in NT/W2K/XP/Wk3 yada yada

Clay Calvert

unread,
Nov 8, 2007, 12:43:17 AM11/8/07
to
>>There are command-line features missing in Home that exist in the
>>others, and as has been discussed, there are features not in the
>>64-bit version. Media Center and Tablet PC are both based of the
>>32-bit XP Pro.
>
>I'm not sure one can be definitive, Clay. Various things are introduced and
>fixed or changed in service packs and would be onerous to document which is
>which in NT/W2K/XP/Wk3 yada yada

Well, the Service Pack level was already mentioned, just not the
specific edition of the operating system. The latter, I'd think,
would be more significant.

Your point is exactly right. These OSes are different, but they are
often treated as the same. "One script fits all."

It is onerous, but not impossible to note the differences between the
command-line capabilities of the OSes you listed. Many of the
differences have already been noted in this forum. Here are some
examples:

http://groups.google.com/group/alt.msdos.batch.nt/msg/e6e3c4455434ece9

http://groups.google.com/group/alt.msdos.batch.nt/msg/2e01447d8832a27a

Thanks,
Clay

foxidrive

unread,
Nov 8, 2007, 1:11:06 AM11/8/07
to
On Thu, 08 Nov 2007 00:43:17 -0500, Clay Calvert <ccal...@Zanguru.com> wrote:

>Your point is exactly right. These OSes are different, but they are
>often treated as the same. "One script fits all."

Well... if the OS is mentioned then that is planned for otherwise people,
including myself, generally try for universal or 'most-common' solutions.

>It is onerous, but not impossible to note the differences between the
>command-line capabilities of the OSes you listed. Many of the
>differences have already been noted in this forum.

I note your fine chart but these things are not in one place, as Timo attempts
with his FAQ - and this thread continued with inappropriate baiting and sniping
at him for it.

Bat Lang maintained the MUF (Microsoft Undocumented Features) for many years
and that was useful to the same people that would read Timo's batch FAQs. We
owe both him and Timo, and other's like William Allen, a debt of gratitude for
their persistance and efforts in maintaining resources for people interested in
batch files, not disparagement.


>http://groups.google.com/group/alt.msdos.batch.nt/msg/e6e3c4455434ece9

>Has anyone ever seen a definitive list of what commands are on what
>OS? Including 64-bit versions of the OS? That sure would be handy.

>Simon Sheppard are you reading this? I could help with the chart if
>you'd host it, and then the chart could link to the individual command
>pages.

Was this taken any further, Clay?

Timo Salmi

unread,
Nov 8, 2007, 2:30:46 AM11/8/07
to
Clay Calvert <ccal...@Zanguru.com> wrote:
> On Wed, 07 Nov 2007 07:02:06 +0200, Timo Salmi <t...@uwasa.fi> wrote:
>> Right. The environment that
>> ftp://garbo.uwasa.fi/pc/link/tscmd.zip
>> Useful NT/2000/XP script tricks and tips, T.Salmi
>> best covers and is tested for is (currently) XP SP2.

> Timo, it might be worthwhile to specify _which_ version of XP because
> there are several, including a 64-bit version. Here are the versions
> of XP.

> - Professional Edition

That's the one.

Thank you, Clay. That is a very useful tip. I'll add that information.

Clay Calvert

unread,
Nov 8, 2007, 1:55:57 PM11/8/07
to
On Thu, 08 Nov 2007 17:11:06 +1100, foxidrive <got...@woohoo.invalid>
wrote:

>I note your fine chart but these things are not in one place, as Timo attempts
>with his FAQ - and this thread continued with inappropriate baiting and sniping
>at him for it.

Note that I wasn't sniping. My response to Timo was just an intent to
clarify. As you can see from my previous posts, I am quite concerned
about the differences in the command-line of the OSes covered by this
group. NT seems so limited compared to Server 2003.

>>http://groups.google.com/group/alt.msdos.batch.nt/msg/e6e3c4455434ece9
>
>>Has anyone ever seen a definitive list of what commands are on what
>>OS? Including 64-bit versions of the OS? That sure would be handy.
>
>>Simon Sheppard are you reading this? I could help with the chart if
>>you'd host it, and then the chart could link to the individual command
>>pages.
>
>Was this taken any further, Clay?

No, it wasn't. The offer still stands. I'll help with the chart if
someone would host it. I think Simon's site would be a great location
since he already has most of the commands documented.

Thanks

0 new messages