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

tscmd14.zip Useful NT/2000/XP script tricks and tips

30 views
Skip to first unread message

Timo Salmi

unread,
Dec 27, 2003, 11:24:44 AM12/27/03
to
Sat 27-Dec-2003: The new NT/2000/XP FAQ items still come relevant at
a fair pace. Hence made the next update available, as usual as

56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked

With the version number the file is
ftp://garbo.uwasa.fi/pc/ts/tscmd14.zip

This time added the following items
39} Is there a subroutine to convert a variable into uppercase?
40} How do I get the number of arguments given to a script?
41} How can I create a zero-byte file? How do I test for it?
42} What is the subroutine for testing a filename for wildcards?
43} Is there a way of counting the number of files in a folder?
44} How do I get the first 68 columns from a text file?

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

Uno

unread,
Dec 27, 2003, 2:19:13 PM12/27/03
to
"Timo Salmi" <t...@UWasa.Fi> wrote in message news:ts20031227...@poiju.uwasa.fi...

> Sat 27-Dec-2003: The new NT/2000/XP FAQ items still come relevant at
> a fair pace. Hence made the next update available, as usual as
>
> 56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
> tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked

Hi,
just a note about 15):
Is it possible to echo without linefeed like the Unix echo -n?

Yes :

@echo off
set a=E100 BE 82 0 8A 14 B4 2 CD"!"83 C6 1 80"<"D"u"F2 C3
echo exit|cmd/Kprompt $_Nech#.com$_%a%$_rcx$_12$_W$_Q|debug>nul
ech#.com test>test.txt
del ech#.com

Source code of ech#.com:

MOV SI,82
MOV DL,[SI]
MOV AH,02
INT 21
ADD SI,1
CMP BYTE PTR [SI],0D
JNZ 103
RET

Herbert Kleebauer

unread,
Dec 27, 2003, 2:40:38 PM12/27/03
to

Did you really test this in W2k/XP?

Uno

unread,
Dec 27, 2003, 3:31:46 PM12/27/03
to

"Herbert Kleebauer" <kl...@unibwm.de> wrote in message news:3FEDE036...@unibwm.de...

Of course,why?
you have to run the cmd file from the command prompt,
(or double click)
not copy and paste to the command prompt.


Herbert Kleebauer

unread,
Dec 27, 2003, 4:21:34 PM12/27/03
to
Uno wrote:

> > > @echo off
> > > set a=E100 BE 82 0 8A 14 B4 2 CD"!"83 C6 1 80"<"D"u"F2 C3
> > > echo exit|cmd/Kprompt $_Nech#.com$_%a%$_rcx$_12$_W$_Q|debug>nul
> > > ech#.com test>test.txt
> > > del ech#.com
> > >
> > > Source code of ech#.com:
> > >
> > > MOV SI,82
> > > MOV DL,[SI]
> > > MOV AH,02
> > > INT 21
> > > ADD SI,1
> > > CMP BYTE PTR [SI],0D
> > > JNZ 103
> > > RET
> >
> > Did you really test this in W2k/XP?
>
> Of course,why?

Because at least in the German version of W2k (in opposite to win9x/NT)
the command line starts at 0x81 instead of 0x82 (the space after the
program name is not stored at 0x81).

After executing the command

ech#.com test>test.txt

the content of test.txt should be "est" for W2k/XP and "test" for
DOS6/Win9x/ME/NT.

Uno

unread,
Dec 27, 2003, 4:23:39 PM12/27/03
to

"Herbert Kleebauer" <kl...@unibwm.de> wrote in message news:3FEDF7DE...@unibwm.de...

I tested my file in XP and the output is test


Matthias Tacke

unread,
Dec 27, 2003, 4:36:35 PM12/27/03
to
Herbert Kleebauer wrote:

In respect to my limited asm knowledge I was so keen and tested it with
a german w2k and the content was:
======copy of screen output=========
C:\test>dumphex test.txt
DumpHex Version 1.0.1
Copyright (c) 2003 Robert Bachmann

00000000h: 74 65 73 74 test

C:\test>
======copy of screen output=========

--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm

Ted Davis

unread,
Dec 27, 2003, 8:29:49 PM12/27/03
to
On Sat, 27 Dec 2003 19:19:13 GMT, "Uno" <nos...@no.spam> wrote:

>"Timo Salmi" <t...@UWasa.Fi> wrote in message news:ts20031227...@poiju.uwasa.fi...
>> Sat 27-Dec-2003: The new NT/2000/XP FAQ items still come relevant at
>> a fair pace. Hence made the next update available, as usual as
>>
>> 56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
>> tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
>
>Hi,
>just a note about 15):
>Is it possible to echo without linefeed like the Unix echo -n?
>
>Yes :
>
>@echo off
>set a=E100 BE 82 0 8A 14 B4 2 CD"!"83 C6 1 80"<"D"u"F2 C3
>echo exit|cmd/Kprompt $_Nech#.com$_%a%$_rcx$_12$_W$_Q|debug>nul
>ech#.com test>test.txt
>del ech#.com

Well, that's too short to be a virus, but it's plenty long enough to
be dangerous - users are advised that it is generally considered
pretty stupid to use binary programs downloaded from newsgroups - it
is better to assemble from source, but there is never any reason to
believe that source presented along with a binary is actually the
source for that binary. It is less difficult to write a script to
create the binary from the source (using DEBUG) than it is to write a
script to create the same program from hex or ASCII, if the source is
available - inclusion of both raises alarms all over the place,
though, of course, it could be just someone trying to show off rather
than offer safe and usable assistance to someone who asked a question.


T.E.D. (tda...@gearbox.maem.umr.edu - e-mail must contain "T.E.D." or my .sig in the body)

Timo Salmi

unread,
Dec 28, 2003, 12:45:17 AM12/28/03
to
In article <RWkHb.12337$VW.5...@news3.tin.it>, Uno <nos...@no.spam> wrote:
> "Timo Salmi" <t...@UWasa.Fi> wrote in message news:ts20031227...@poiju.uwasa.fi...
> > 56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
> > tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
> just a note about 15):
> Is it possible to echo without linefeed like the Unix echo -n?

> @echo off


> set a=E100 BE 82 0 8A 14 B4 2 CD"!"83 C6 1 80"<"D"u"F2 C3

:


> Source code of ech#.com:
> MOV SI,82

Similarly, the sister package for MS-DOS+Win..95/98/Me

243153 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi

contains
ECHON.EXE echo -n, Echo without a linefeed Oct-14-2001 07:28:02

which works also on NT/2000/XP (or at least XP, since I can't test
the others).

@echo off & setlocal enableextensions
C:\_F\BAT\ECHON Testline 1
C:\_F\BAT\ECHON Testline 2
C:\_F\BAT\ECHON Testline 3
endlocal & goto :EOF

D:\TEST>cmdfaq
Testline 1Testline 2Testline 3

Many the tsbat.zip solutions not necessarily included in tscmd.zip
work for NT/2000/XP. However, the reverse is not true. Most of the
code in tscmd.zip is not valid for MS-DOS+Win..95/98/Me.

Herbert Kleebauer

unread,
Dec 28, 2003, 1:11:35 AM12/28/03
to
Matthias Tacke wrote:

> >Because at least in the German version of W2k (in opposite to win9x/NT)
> >the command line starts at 0x81 instead of 0x82 (the space after the
> >program name is not stored at 0x81).
> >
> >After executing the command
> >
> >ech#.com test>test.txt
> >
> >the content of test.txt should be "est" for W2k/XP and "test" for
> >DOS6/Win9x/ME/NT.
>
> In respect to my limited asm knowledge I was so keen and tested it with
> a german w2k and the content was:
>

> 00000000h: 74 65 73 74 test

Now I'm really surprised. I currently don't have a W2k available, so
I have to wait till "next year" to test it. Maybe it was considered
as a bug and fixed in a service pack.

Phil Robyn

unread,
Dec 28, 2003, 3:40:59 AM12/28/03
to
Uno wrote:
> "Timo Salmi" <t...@UWasa.Fi> wrote in message news:ts20031227...@poiju.uwasa.fi...
>
>>Sat 27-Dec-2003: The new NT/2000/XP FAQ items still come relevant at
>>a fair pace. Hence made the next update available, as usual as
>>
>> 56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
>> tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
>
>
> Hi,
> just a note about 15):
> Is it possible to echo without linefeed like the Unix echo -n?
>
> Yes :

In Win2000 or WinXP (*not* NT 4.0):

<Win2000> c:\cmd>demo\TestNoCRLF
One . . . Two . . . Three.

<Win2000> c:\cmd>rlist demo\TestNoCRLF.cmd
=====begin c:\cmd\demo\TestNoCRLF.cmd ====================
1. @echo off
2. setlocal
3. echo/|set /p =One
4. ping -n 2 127.0.0.1 > nul
5. echo/|set /p = . . . Two
6. ping -n 2 127.0.0.1 > nul
7. echo/ . . . Three.
=====end c:\cmd\demo\TestNoCRLF.cmd ====================


--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l

Timo Salmi

unread,
Dec 28, 2003, 5:56:48 AM12/28/03
to
Phil Robyn <zipp...@uclink.berkeley.edu> wrote:
> 3. echo/|set /p =One
> 4. ping -n 2 127.0.0.1 > nul
> 5. echo/|set /p = . . . Two

Phil, your solution is by far the best presented. Well done yet
again! Yours does not require anything external. But why the line 4
at all?

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

Timo Salmi

unread,
Dec 28, 2003, 6:24:44 AM12/28/03
to
In article <bsmctg$b...@poiju.uwasa.fi>, Timo Salmi <t...@UWasa.Fi> wrote:
> Phil Robyn <zipp...@uclink.berkeley.edu> wrote:
> > 3. echo/|set /p =One
(snip)a

> Phil, your solution is by far the best presented. Well done yet
> again! Yours does not require anything external.

Based on your solution, added

Comments:
http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de

Phil's solution in the comment demonstrates that this task can be
solved without external tools. The solution below is based on Phil's
posting. Note the ^quoting of 1, 2, and 3 lest they be taken as
handles.
@echo off & setlocal
echo.|set /p=Testline ^1>tmp.txt
echo.|set /p=Testline ^2>>tmp.txt
echo.Testline ^3>>tmp.txt
for %%c in (type del) do %%c tmp.txt
endlocal
The output will be
D:\TEST>cmdfaq
Testline 1 Testline 2 Testline 3

Uno

unread,
Dec 28, 2003, 8:13:54 AM12/28/03
to

"Timo Salmi" <t...@UWasa.Fi> wrote in message news:bsmehs$c...@poiju.uwasa.fi...


> In article <bsmctg$b...@poiju.uwasa.fi>, Timo Salmi <t...@UWasa.Fi> wrote:
> > Phil Robyn <zipp...@uclink.berkeley.edu> wrote:
> > > 3. echo/|set /p =One
> (snip)a
>
> > Phil, your solution is by far the best presented. Well done yet
> > again! Yours does not require anything external.
>
> Based on your solution, added
>
> Comments:
> http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de
>
> Phil's solution in the comment demonstrates that this task can be
> solved without external tools. The solution below is based on Phil's
> posting. Note the ^quoting of 1, 2, and 3 lest they be taken as
> handles.
> @echo off & setlocal
> echo.|set /p=Testline ^1>tmp.txt
> echo.|set /p=Testline ^2>>tmp.txt
> echo.Testline ^3>>tmp.txt
> for %%c in (type del) do %%c tmp.txt
> endlocal
> The output will be
> D:\TEST>cmdfaq
> Testline 1 Testline 2 Testline 3

Can you echo the character > without CR LF ?


Matthias Tacke

unread,
Dec 28, 2003, 8:14:08 AM12/28/03
to
Timo Salmi wrote:

>In article <bsmctg$b...@poiju.uwasa.fi>, Timo Salmi <t...@UWasa.Fi> wrote:
>> Phil Robyn <zipp...@uclink.berkeley.edu> wrote:
>> > 3. echo/|set /p =One
>(snip)a

Hmm, to use set /P for an echo without crlf is a commonly used technic.
I learned it here several weeks ago. This variant from Phil doesn't use
a "dummy" variable which is creative.
I've used a <NUL to terminate the pseudo input and not an echo cause of
the true pipe with the overhead of a second cmd.

>
>> Phil, your solution is by far the best presented. Well done yet
>> again! Yours does not require anything external.
>
>Based on your solution, added
>
>Comments:
>http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de

This doesn't work ?
Google has the thread, but not Phil's posting - strange.
http://www.google.com/groups?threadm=3FEE7417.717ABC7C%40unibwm.de

Matthias Tacke

unread,
Dec 28, 2003, 8:46:39 AM12/28/03
to
"Uno" wrote:

If you use the escape character ^ should be no problem.
See how this selfmodifying batch does it:

::ChangeMyself.cmd:::::::::::::::::::::::::::::::::::::


@echo off & setlocal enableextensions

set /P =echo/echo/This line added to %0 <NUL>add2me.cmd
echo/^>^>%0>>add2me.cmd
call add2me.cmd
del add2me.cmd
:::::::::::::::::::::::::::::::::::::::::::::::::::::::

Matthias Tacke

unread,
Dec 28, 2003, 9:04:36 AM12/28/03
to
"Matthias Tacke" wrote:
>"Uno" wrote:
>>"Timo Salmi" <t...@UWasa.Fi> wrote
>set /P =echo/echo/This line added to %0 ^><NUL>add2me.cmd
To demonstrate the effect this is much better ;-)

>echo/^>%0>>add2me.cmd

Jim

unread,
Dec 28, 2003, 9:25:38 AM12/28/03
to

> >::ChangeMyself.cmd:::::::::::::::::::::::::::::::::::::
> >@echo off & setlocal enableextensions
> >set /P =echo/echo/This line added to %0 ^><NUL>add2me.cmd
> To demonstrate the effect this is much better ;-)
>
> >echo/^>%0>>add2me.cmd
> >call add2me.cmd
> >del add2me.cmd
> >:::::::::::::::::::::::::::::::::::::::::::::::::::::::

I can't see the echoed > character !


Timo Salmi

unread,
Dec 28, 2003, 9:41:58 AM12/28/03
to
Matthias Tacke <Matt...@Tacke.de> wrote:

> Timo Salmi wrote:
> >Comments:
> >http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de
> This doesn't work ?
> Google has the thread, but not Phil's posting - strange.

Not so fast :-). Google has a delay, which usually is up to a day. I
took the message-id from the original posting's headers, not from
Google. But now it seems to have gotten there.

Matthias Tacke

unread,
Dec 28, 2003, 11:00:19 AM12/28/03
to
"Jim" wrote:

Yes, I should have this better commented.

The set statement above puts this into the intermediate file add2me.cmd:

echo/echo/This line added to (however you name the file) >EOF no crlf!

the echo then appends ">(however you name the file)

If you took my naming the file add2me.cmd looks like this:
echo/echo/This line added to ChangeMyself.cmd >>ChangeMyself.cmd

Since this intermediate file is deleted afterwards you can't see that.
But if you got the line "This line..." echoed it had functioned.

Uno's question :


>>Can you echo the character > without CR LF ?

Is though answered by example. Even if the proof is deleted - if the
first ">" wouldn't have been output the second one would have messed up
the runnning cmd file.

Phil Robyn

unread,
Dec 28, 2003, 12:23:57 PM12/28/03
to
Timo Salmi wrote:
> Phil Robyn <zipp...@uclink.berkeley.edu> wrote:
>
>>3. echo/|set /p =One
>>4. ping -n 2 127.0.0.1 > nul
>>5. echo/|set /p = . . . Two
>
>
> Phil, your solution is by far the best presented. Well done yet
> again! Yours does not require anything external. But why the line 4
> at all?
>
> All the best, Timo
>

The short delay provided by line 4 makes it easier to see what is
really happening.

Herbert Kleebauer

unread,
Dec 28, 2003, 3:07:48 PM12/28/03
to
Matthias Tacke wrote:
>
> Hmm, to use set /P for an echo without crlf is a commonly used technic.

Any "commonly used technic" once was new. And as far as I remember,
Phil was the first who used this method at least in this news group.

Matthias Tacke

unread,
Dec 28, 2003, 3:34:40 PM12/28/03
to
Herbert Kleebauer wrote:

--

Matthias Tacke

unread,
Dec 28, 2003, 3:38:04 PM12/28/03
to
Herbert Kleebauer wrote:

If he's the originator all honours belong to him.
If I'd known, I'd mentioned it.

Phil Robyn

unread,
Dec 28, 2003, 4:19:08 PM12/28/03
to
Herbert Kleebauer wrote:

Actually, I think that it was Frank Westlake who first used this technique
in this newsgroup. :-)

Ritchie

unread,
Dec 28, 2003, 4:40:27 PM12/28/03
to
"Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message news:bsnhcd$ekr9d$1...@ID-55492.news.uni-berlin.de...

> Actually, I think that it was Frank Westlake who first used this technique
> in this newsgroup. :-)

I think it was Al. I found a post of his dated nine months before Frank was aware of
the technique:-

Subject: ECHO without terminating CRLF - was "Re: com1 input"
Newsgroups: microsoft.public.win2000.cmdprompt.admin
Date: 2002-02-15 21:08:44 PST
http://groups.google.com/groups?threadm=%23qRDtfqtBHA.2608%40tkmsftngp04

Subject: Re: Progress Bar
Newsgroups: microsoft.public.win2000.cmdprompt.admin
Date: 2002-11-21 03:34:42 PST
http://groups.google.com/groups?threadm=01c29151%24d3379950%240125250a%40mjtfqbuyhrfregky

--
Ritchie


Phil Robyn

unread,
Dec 28, 2003, 6:38:56 PM12/28/03
to
Ritchie wrote:

Hi, Ritchie,

Yes, I think you are correct. Thanks for making me go back and read these
old posts. I had completely forgotten about using SET /P to write the
'poison' characters to a file without prefacing them with carets.

<nul (set /p z="<this>|<is>|<only>|<a>|<TEST>")>out.txt

Dr John Stockton

unread,
Dec 28, 2003, 4:45:57 PM12/28/03
to
JRS: In article <bslqld$7...@poiju.uwasa.fi>, seen in
news:alt.msdos.batch.nt, Timo Salmi <t...@UWasa.Fi> posted at Sun, 28 Dec
2003 07:45:17 :-

>In article <RWkHb.12337$VW.5...@news3.tin.it>, Uno <nos...@no.spam> wrote:
>> "Timo Salmi" <t...@UWasa.Fi> wrote in message news:ts20031227...@poiju.uw
>asa.fi...
>> > 56675 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
>> > tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi, linked
>> just a note about 15):
>> Is it possible to echo without linefeed like the Unix echo -n?
>
>> @echo off
>> set a=E100 BE 82 0 8A 14 B4 2 CD"!"83 C6 1 80"<"D"u"F2 C3
>:
>> Source code of ech#.com:
>> MOV SI,82
>
>Similarly, the sister package for MS-DOS+Win..95/98/Me
>
> 243153 Dec 27 2003 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
> tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi
>
>contains
>ECHON.EXE echo -n, Echo without a linefeed Oct-14-2001 07:28:02

EKKO, via sig line 3, will echo any combination of characters, and
appends none automatically. It copies standard input first, and can be
used to generate < & >, for example.

It should work on anything with some DOS compatibility.

Is the format of Oct-14-2001 forced on unwilling Finns by MS, or is it a
personal or national preference?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

Al Dunbar

unread,
Dec 28, 2003, 7:10:38 PM12/28/03
to

"Ritchie" <qiournvdlirh...@hotmail.com> wrote in message
news:bsnika$ep1j3$3...@ID-156657.news.uni-berlin.de...

Sheesh! Even *I* don't have the time to go googling through the archives to
prove I did something first! I hope you manage to get out at least a little
bit over the holidays, Ritchie. ;-)

/Al

PS: and thanks for the Christmas present!


Al Dunbar

unread,
Dec 28, 2003, 7:13:10 PM12/28/03
to

"Ritchie" <qiournvdlirh...@hotmail.com> wrote in message
news:bsnika$ep1j3$3...@ID-156657.news.uni-berlin.de...

As I recall, Frank was mainly into NT4. His comment in the second thread
above must have come shortly after he started dabbling in w2k, otherwise I
am quite sure he would have beaten me to this one too.

And speaking of Frank... ?


/Al


Matthias Tacke

unread,
Dec 28, 2003, 8:05:22 PM12/28/03
to
"Al Dunbar" wrote:
>"Ritchie" wrote in message

>> "Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message
>> > Actually, I think that it was Frank Westlake who first used this
>> > technique in this newsgroup. :-)
>>
>> I think it was Al. I found a post of his dated nine months before
>> Frank was aware of the technique:-
>>
>> Subject: ECHO without terminating CRLF - was "Re: com1 input"
>> Newsgroups: microsoft.public.win2000.cmdprompt.admin
>> Date: 2002-02-15 21:08:44 PST
>> http://groups.google.com/groups?threadm=%23qRDtfqtBHA.2608%40tkmsf
>> tngp04
>>
>> Subject: Re: Progress Bar
>> Newsgroups: microsoft.public.win2000.cmdprompt.admin
>> Date: 2002-11-21 03:34:42 PST
>>
>http://groups.google.com/groups?threadm=01c29151%24d3379950%240125250a%40mjtfqbuyhrfregky
>As I recall, Frank was mainly into NT4. His comment in the second
>thread above must have come shortly after he started dabbling in w2k,
>otherwise I am quite sure he would have beaten me to this one too.
>

Thank you guys,
for the extra lesson - I'll take it as a christmas gift :-)

--
Greetings
Matthias

Timo Salmi

unread,
Dec 28, 2003, 11:59:15 PM12/28/03
to
Ritchie <qiournvdlirh...@hotmail.com> wrote:
> "Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message news:bsnhcd$ekr9d$1...@ID-55492.news.uni-berlin.de...
> > Actually, I think that it was Frank Westlake who first used this technique

> I think it was Al. I found a post of his dated nine months before Frank was aware of
> the technique:-

> Subject: ECHO without terminating CRLF - was "Re: com1 input"
> Newsgroups: microsoft.public.win2000.cmdprompt.admin

Thank you. I'll be insterting two reference links:
http://www.google.com/groups?selm=%23qRDtfqtBHA.2608%40tkmsftngp04
http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de
There is "value-added" in both the postings.

Uno

unread,
Dec 29, 2003, 5:43:53 AM12/29/03
to

"Timo Salmi" <t...@UWasa.Fi> wrote in message news:bsocb3$n...@poiju.uwasa.fi...


> Ritchie <qiournvdlirh...@hotmail.com> wrote:
> > "Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message news:bsnhcd$ekr9d$1...@ID-55492.news.uni-berlin.de...
> > > Actually, I think that it was Frank Westlake who first used this technique
>
> > I think it was Al. I found a post of his dated nine months before Frank was aware of
> > the technique:-
>
> > Subject: ECHO without terminating CRLF - was "Re: com1 input"
> > Newsgroups: microsoft.public.win2000.cmdprompt.admin
>
> Thank you. I'll be insterting two reference links:
> http://www.google.com/groups?selm=%23qRDtfqtBHA.2608%40tkmsftngp04
> http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de
> There is "value-added" in both the postings.


I found another way to echo without crlf:

ech test>test.txt
ech test2>>test.txt

Ritchie

unread,
Dec 29, 2003, 7:17:19 AM12/29/03
to
"Timo Salmi" <t...@UWasa.Fi> wrote in message news:bsocb3$n...@poiju.uwasa.fi...

Carry on like this and soon you'll have a Google mirror <g>

--
Ritchie


Timo Salmi

unread,
Dec 29, 2003, 9:15:43 AM12/29/03
to
In article <bsp60f$f73q7$1...@ID-156657.news.uni-berlin.de>,

Ok :-). Seriously, though. Credit where credit is due. And not
sensible to reproduce everything. Yet, the references are only a
small part the whole, and each item hopefully is self-contained
enough to serve in a FAQ.

Al Dunbar

unread,
Dec 29, 2003, 7:43:09 PM12/29/03
to

"Timo Salmi" <t...@UWasa.Fi> wrote in message
news:bsocb3$n...@poiju.uwasa.fi...
> Ritchie <qiournvdlirh...@hotmail.com> wrote:
> > "Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message
news:bsnhcd$ekr9d$1...@ID-55492.news.uni-berlin.de...
> > > Actually, I think that it was Frank Westlake who first used this
technique
>
> > I think it was Al. I found a post of his dated nine months before Frank
was aware of
> > the technique:-
>
> > Subject: ECHO without terminating CRLF - was "Re: com1 input"
> > Newsgroups: microsoft.public.win2000.cmdprompt.admin
>
> Thank you. I'll be insterting two reference links:
> http://www.google.com/groups?selm=%23qRDtfqtBHA.2608%40tkmsftngp04
>
http://www.google.com/groups?selm=bsm4uq$e6f4a$1...@ID-55492.news.uni-berlin.de
> There is "value-added" in both the postings.

Yes. In the last one, Phil uses the technique with a nul variable name -
surely a good way to code to show that the intent is not to accept a new
value for an environment variable.

/Al


Al Dunbar

unread,
Dec 29, 2003, 7:44:31 PM12/29/03
to

"Uno" <nos...@no.spam> wrote in message
news:JzTHb.20152$_P.9...@news4.tin.it...

Ech, that's way uglee. Or at least it uses something not native to 2k/xp.

/Al


Herbert Kleebauer

unread,
Jan 4, 2004, 1:57:13 PM1/4/04
to
Herbert Kleebauer wrote:
>
> Matthias Tacke wrote:
>
> > >Because at least in the German version of W2k (in opposite to win9x/NT)
> > >the command line starts at 0x81 instead of 0x82 (the space after the
> > >program name is not stored at 0x81).
> > >
> > >After executing the command
> > >
> > >ech#.com test>test.txt
> > >
> > >the content of test.txt should be "est" for W2k/XP and "test" for
> > >DOS6/Win9x/ME/NT.
> >
> > In respect to my limited asm knowledge I was so keen and tested it with
> > a german w2k and the content was:
> >
> > 00000000h: 74 65 73 74 test
>
> Now I'm really surprised. I currently don't have a W2k available, so
> I have to wait till "next year" to test it. Maybe it was considered
> as a bug and fixed in a service pack.

Just tried it in: W2k 5.00.2195 Service Pack 2:

00000 65 73 74 est

This means that cmd.exe was modified in a service pack > 2.

0 new messages