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

Old syntax

1 view
Skip to first unread message

Erlend Bergsås Mikkelsen

unread,
Nov 29, 2001, 5:19:15 AM11/29/01
to
Hello,

I've got a problem with the 'state of the art' dos.
I'm used to DOS 6.22 where

for %%v in (/DD) do echo %%v

would produce 'echo D' and echo 'D'. (I don't remember if it's (/DD), (DD/))
Anyhow - is it possible to emulate this in NT, 2k or XP?

--
Mvh
Erlend Bergsås Mikkelsen
ho...@online.no


William Allen

unread,
Nov 29, 2001, 7:29:49 AM11/29/01
to
"Erlend Bergsås Mikkelsen" wrote in message

> Hello,
>
> I've got a problem with the 'state of the art' dos.
> I'm used to DOS 6.22 where
>
> for %%v in (/DD) do echo %%v
>
> would produce 'echo D' and echo 'D'. (I don't remember if it's (/DD), (DD/))
> Anyhow - is it possible to emulate this in NT, 2k or XP?

The syntax you mean is /DD. In legacy MS-DOS this splits
a two element string DD into two parts. And if all you want to
do is split a string such as DD into separate characters, it's
certainly trivial in Win2000 and higher, since _full_ string parsing
with variables is included.

Type SET /? in Win2000 for instructions.

Simple example of substring extraction from offset 3, for 6 characters:
=======
C:\WRK2>SET TESTVAR=AnyStringYouLike

C:\WRK2>ECHO %TESTVAR:~3,6%
String

C:\WRK2>
======

--
William Allen


William Allen

unread,
Nov 29, 2001, 7:44:23 AM11/29/01
to
"William Allen" wrote in message
...snip

> Simple example of substring extraction from offset 3, for 6 characters:
> =======
> C:\WRK2>SET TESTVAR=AnyStringYouLike
>
> C:\WRK2>ECHO %TESTVAR:~3,6%
> String
>
> C:\WRK2>
> ======

Incidentally, this screen capture was made in Windows 95
using a Win95cmd custom DVM, which enables you to learn
about cross-syntax between the 6-7-8 MS-DOS series and
the Win2000 MS-DOS series.

Windows 95/98 users who need more information on such
cross-syntax issues can use the simple kludge installation
for Win95cmd.exe detailed in Note 1.

--
William Allen

======Note 1
Win95cmd.exe is an extension/batch enhancer for Windows 95/98/ME
users interested in using some (not all) enhanced batch language
features from Win2000. It appears to be a demo included with the
Win2000 SDK (Software Development Kit), probably used in simple
presentations, but it's downloadable free from the URLs below.

Probably better to look here:
Win95cmd.exe file is available as a single small ZIP from:
http://www.neuro.gatech.edu/users/cwilson/cygutils/unversioned/consize/

But it's also here (last time I looked) as part of the MS CAB package:
psdk-x86.49.cab:
ftp://ftp.microsoft.com/developr/platformsdk/oct2000/psdk-x86.49.cab
(Note: this is a large CAB file and this site is subject to reorganisation)

======

Normal use with Batch files is to shell to it to add its features
to the Batch language, and it needs no "installing" other than
placing in C:\WINDOWS. For study purposes, however, the
following simple kludge install is useful while learning about it.
Once installed this way, in particular try typing
FOR /?
and
SET /?
for the huge amount of documentation on the many additional
features available with this useful free enhancement.

1)
To work with it for study purposes, create a custom DVM consisting
of a shortcut to COMMAND.COM, and point the initialising batch
file field to a Batch script consisting of:
====
@ECHO OFF
C:\WINDOWS\WIN95CMD.EXE /k CLS
====
(alter the line to the location you use for WIN95CMD.EXE
This gets round the problem that a direct shortcut to it
doesn't preserve FONT settings in the DVM properties.
This gives you a DVM running the WIN95CMD shell.

2)
In this shortcut Properties, Miscellaneous Tab, Other section,
make sure "Fast pasting" is unchecked. This allows normal pasting
to the WIN95CMD DVM, which is obviously necessary for quick
learning. This enables cut-and-paste to the Win95cmd window in
the usual way.

3)
The internal WIN95CMD TYPE command is Unicode compliant,
following the Win2000 standard, and doesn't work correctly with
non-Unicode files. Simply shell to:
COMMAND.COM /C TYPE
to type non-unicode files.

General points:
1)
The above method allows quite a number of features, particularly
many of the FOR IN DO extensions, to be used.
Type FOR /? for the huge list of extra FOR IN DO features
Type SET /? for the extensions to the SET command
and in general most of the InternalCommand /? help is worth reading.

2)
Some _internal_ commands generate ERRORLEVELs and the
current ERRORLEVEL can be echoed from the same-name
system variable:
ECHO. %ERRORLEVEL%

3)
You can shell to Win95cmd for a single command from a
Win95/98/ME batch file, so assuming you have Win95cmd in
your path, this can be used to, for example capture the
system DATE variable from Win95cmd:

============Screen capture in Windows 95 DOS box
C:\WORK>ver

Windows 95. [Version 4.00.1111]


C:\WORK>win95cmd /c ECHO.SET DATE=%%DATE%%>D.BAT

C:\WORK>type d.bat
SET DATE=Thu 22/11/2001

C:\WORK>
============End screen capture
Note the doubled %% in the /c shell command, since
the code needs to pass through two stages of parsing.
Simply run D.BAT to capture the variable in Windows 9x.

======

Some known problems with the above installation:

a) CapsLock works as a general ShiftLock so non-alpha keys
are out-shifted too.

b) The pipe character doesn't appear to be translated properly
so piping isn't handled

c) FOR IN DO parsing of files isn't handled, but text strings can
be parsed.

d) DOSKEY starts in overtype mode regardless of system setting.

In general, you should regard Win95cmd set up this way as a
useful educational tool, but practical uses seem to be growing.


Erlend Bergsås Mikkelsen

unread,
Nov 29, 2001, 3:33:22 PM11/29/01
to
"William Allen" <ma...@mayfly13.fsnet.co.uk> wrote in message
news:9u59qv$67s58$1...@ID-55970.news.dfncis.de...

OK, thanks - so I'll have to detect if it's real dos or crap dos.
To bad there isn't compatibility in things MS creates - they could at least
make it possible to disable all the new stuff, and only use good old syntax.

This isn't because I don't like the new syntax, but I don't like that is
hasn't backwardscompability.

Erlend Bergsås Mikkelsen


Ted Davis

unread,
Nov 29, 2001, 5:05:58 PM11/29/01
to

An alternative that works well in many cases is to use a secondary
(third party) language or utility that has good string processing
functions to process the strings and then write a batch file that the
parent program calls to set an environment variable to the result or
to take some action. It means either using a language that you know
is installed on all systems of interest, doesn't need installation and
is in the PATH (or a known location), that is provided with the batch
program, or produces a compiled executable that can be put in one of
those places. AWK (gawk) (because of its simplicity and powerful
string functions), Perl (because of its popularity), and Qbasic
(because it's from Microsoft - never mind the ugly flash screen)
readily come to mind.

T.E.D. (tda...@gearbox.maem.umr.edu)
SPAM filter: Messages to this address *must* contain "T.E.D."
somewhere in the body or they will be automatically rejected.

Rik D'haveloose

unread,
Nov 29, 2001, 3:08:42 PM11/29/01
to
William Allen wrote

> > Simple example of substring extraction from offset 3, for 6
characters:

for NT only !!

==8<


> Incidentally, this screen capture was made in Windows 95
> using a Win95cmd custom DVM, which enables you to learn
> about cross-syntax between the 6-7-8 MS-DOS series and
> the Win2000 MS-DOS series.

==8<

I see no reason why you should add this info (of an emulator) for
someone who has access to those systems. If he needs to be aware of the
behaviour there, he can fully test it, imho.

When will you cease to be 'unsocial' and 'annoying' in harrassing this
msdos batch NG with off topic postings ? (and also confuse (nowadays
many?) W9x users with unusable commands) and even refuse to redirect to
the correct NG for NT-questions, which i do for you now:

news:alt.msdos.batch.nt

--
TUF Greetings


Todd Vargo

unread,
Dec 2, 2001, 8:50:45 PM12/2/01
to

"Rik D'haveloose" <brol.d...@xs4all.be> wrote in message
news:9ud6ra$4u0$1...@news1.xs4all.nl...

> William Allen wrote
> > > Simple example of substring extraction from offset 3, for 6
> characters:
>
> for NT only !!

Well, since he used win95cmd, it must be for Win9x too. Actually, the line
directly before this (in his first post), instructs the reader to use the
SET/? command, to view it's built in help for instructions. In comparison to
the actual output of that command, his simple example was very brief.

>
> ==8<
> > Incidentally, this screen capture was made in Windows 95
> > using a Win95cmd custom DVM, which enables you to learn
> > about cross-syntax between the 6-7-8 MS-DOS series and
> > the Win2000 MS-DOS series.
> ==8<
>
> I see no reason why you should add this info (of an emulator) for
> someone who has access to those systems. If he needs to be aware of the
> behaviour there, he can fully test it, imho.

IIUC, he was defining what environment was actually used for his testing
since it was not actually the posters own NT environment.

>
> When will you cease to be 'unsocial' and 'annoying' in harrassing this
> msdos batch NG with off topic postings ? (and also confuse (nowadays
> many?) W9x users with unusable commands) and even refuse to redirect to
> the correct NG for NT-questions, which i do for you now:
>
> news:alt.msdos.batch.nt

"Unsocial", "annoying", "harassing"? Those are very harsh words considering
the OP was asking for an equivalent to legacy DOS syntax/behavior. IMO, due
to as many times as us amb readers have seen startup NT users as not having
any prior DOS knowledge, this should be the obvious choice for DOS-vs-NT
batch syntax comparisons.

Also, since WA's first post did include the OP's question and WA did specify
say to "Type SET /? in Win2000 for instructions", there should be no
confusion with that particular post.

>
> --
> TUF Greetings

IMO, this closing is beginning to loose it's original meaning.

FWIW, I've already given my opinions about win95cmd discussions too. But,
all these continued anti-win95cmd/anti-NT postings (not just from you) can
be considered "unsocial", "annoying", even "harassing".

Considering what we already know...

1. This is an alt.unmoderated discussion group.
2. WA has already noted he intends to continue posting Win95
and newer (including GUI oriented) batch material.
3. Many people do pay a _per_minute_ connection fee.

...it's about time these objection posts cease from us amb's regular
readers. WA and other amb regulars already know our opinions. Posting them
one more time wont make a difference. Besides, as you can see, WA don't even
address these type of posts any more anyway. IMO, continued rehashes of the
same old 'post no NT discussions here' type of messages at this point, only
serves to annoy the public at large.

In short, if you don't want to read WA or anyone else's posts, then just
filter them. Please, become part of the solution, not part of the problem.
Think about it people.

--
Todd Vargo (body of message must contain my name to reply by email)

Charles Dye

unread,
Dec 3, 2001, 9:49:51 AM12/3/01
to
"Erlend Bergs? Mikkelsen" <ho...@online.no> wrote in message news:<e_nN7.1372$yB2....@news1.oke.nextra.no>...

> Hello,
>
> I've got a problem with the 'state of the art' dos.
> I'm used to DOS 6.22 where
>
> for %%v in (/DD) do echo %%v
>
> would produce 'echo D' and echo 'D'. (I don't remember if it's (/DD), (DD/))
> Anyhow - is it possible to emulate this in NT, 2k or XP?

This behavior is emulated in 4NT, which is a shareware replacement
for Microsoft's command shell CMD.EXE. Whether or not it's actually
worth $70 to purchace a replacement shell just to emulate an old
Microsoft COMMAND.COM bug is a different question.

http://www.jpsoft.com

--
Charles Dye ras...@highfiber.com

Rik D'haveloose

unread,
Dec 4, 2001, 4:01:08 PM12/4/01
to
Todd Vargo wrote
> "Rik D'haveloose wrote
> > ==8<

> "Unsocial", "annoying", "harassing"? Those are very harsh words
considering
> the OP was asking for an equivalent to legacy DOS syntax/behavior.

and only asking for NT/2000 syntax....(and regretting there is so less
backwards compatibility also)

[emulator/cli tool]


> this should be the obvious choice for DOS-vs-NT
> batch syntax comparisons.

for those interested, which, IMO, is not here in this NG.
==8w


> > TUF Greetings
> IMO, this closing is beginning to loose it's original meaning.

then you miss completely the unimportant...
==8<

> 2. WA has already noted he intends to continue posting Win95
> and newer (including GUI oriented) batch material.

and disregarding (together with others) the social accepted purpose of
the NG.

> 3. Many people do pay a _per_minute_ connection fee.

as myself (and thus, you (and ??) consider that i have to pay for
postings i do not want ??, and loose time in reading those also).
If others are allowed , ....

> WA don't even
> address these type of posts any more anyway.

in more than one way.

> filter them.

thinked about that really ?
(filter= loose also interesting postings, or unable to see if they are)

I short: for me, WA needs to rethink his behaviour here, which stays as
i described (which i deeply regret, but is a fact for me)

--
TUF Greetings


Todd Vargo

unread,
Dec 6, 2001, 8:14:29 PM12/6/01
to

"Rik D'haveloose" <brol.d...@xs4all.be> wrote in message
news:9uohl8$ist$3...@news1.xs4all.nl...

> Todd Vargo wrote
> > "Rik D'haveloose wrote
> > > ==8<
> > "Unsocial", "annoying", "harassing"? Those are very harsh words
> considering
> > the OP was asking for an equivalent to legacy DOS syntax/behavior.
>
> and only asking for NT/2000 syntax....(and regretting there is so less
> backwards compatibility also)
>
> [emulator/cli tool]

No. [DOS-vs-NT syntax]. IMO, big difference. Don't just go by the reply in
the thread. Go by the OP first an foremost.

> > this should be the obvious choice for DOS-vs-NT
> > batch syntax comparisons.
>
> for those interested, which, IMO, is not here in this NG.

At least one person _was_ interested. Also, just because there is an NT
batch group, that don't make this type of discussion any more applicable
there than here. We can't assume all of the readers of that group have
any/enough DOS background to help in these situations.

> ==8w
> > > TUF Greetings
> > IMO, this closing is beginning to loose it's original meaning.
>
> then you miss completely the unimportant...

Sometimes I suppose. I know your well intentioned, but IMO, your over doing
it a bit where policing/reacting to NT and OT in amb goes. Please, lighten
up.

> ==8<
>
> > 2. WA has already noted he intends to continue posting Win95
> > and newer (including GUI oriented) batch material.
>
> and disregarding (together with others) the social accepted purpose of
> the NG.

That may be but, if your reactions are just being ignored, don't you think
by now that your not going to make someone change? In other words, what I'm
saying is... What good is it to continue reacting to the same person over
and over? Trying to make him look bad to the community? IMO it's doubtful to
happen considering the number of people asking for his help by name and
posting gratitude.

>
> > 3. Many people do pay a _per_minute_ connection fee.
>
> as myself (and thus, you (and ??) consider that i have to pay for
> postings i do not want ??, and loose time in reading those also).

Exactly my point. Your paying twice as much for each ignored reaction. Cut
your losses and just filter/ignore the posts that don't apply to your
situation.

> If others are allowed , ....

It's an ALT group. Besides, it's not like he's a brain dead troll. He's
actually posting productive, educational material and solutions, that are
batch related. Consider it like reading a book. Some people prefer to skip
over certain chapters, while others will read the whole book even though
their not really interested in some chapters.

>
> > WA don't even
> > address these type of posts any more anyway.
>
> in more than one way.
>
> > filter them.
>
> thinked about that really ?
> (filter= loose also interesting postings, or unable to see if they are)
>
> I short: for me, WA needs to rethink his behaviour here, which stays as
> i described (which i deeply regret, but is a fact for me)

I'm sure others may feel the same way too, but IMO, constantly reacting is
not the solution. It may even be aggravating matters. Did you (and others)
ever think about that?

Best regards,

Charles Dye

unread,
Dec 6, 2001, 9:54:14 PM12/6/01
to
On Tue, 4 Dec 2001 22:01:08 +0100, "Rik D'haveloose"
<brol.d...@xs4all.be> wrote:

>Todd Vargo wrote

>> this should be the obvious choice for DOS-vs-NT
>> batch syntax comparisons.
>
>for those interested, which, IMO, is not here in this NG.

Why, exactly?

Assuming that newsgroup alt.fan.a is devoted entirely and
only to Product A, and newsgroup alt.fan.b is specifically
for Product B (an oversimplified scenario) then a comparison
of Product A and Product B would be equally at home in either
group. In fact, it might well be crossposted to both. There
may very well be readers in each group who want to maintain
compatibility with both products A and B.

--
Charles Dye ras...@highfiber.com

"I am not an animal."

He chuckled as he ran. "All the animals say that...."

-- Gene Wolfe, "Tracking Song"


Outsider

unread,
Dec 7, 2001, 1:37:54 AM12/7/01
to
Todd Vargo wrote:
>
> > "Rik D'haveloose" <brol.d...@xs4all.be> wrote in message
> > news:9uohl8$ist$3...@news1.xs4all.nl...
> >
> > > 2. WA has already noted he intends to continue posting Win95
> > > and newer (including GUI oriented) batch material.
> >
> > and disregarding (together with others) the social accepted purpose of
> > the NG.
>
> That may be but, if your reactions are just being ignored, don't you think
> by now that your not going to make someone change? In other words, what I'm
> saying is... What good is it to continue reacting to the same person over
> and over? Trying to make him look bad to the community? IMO it's doubtful to
> happen considering the number of people asking for his help by name and
> posting gratitude.

No! We must never acquiesce to wrongful behavior or injustice.
Open your eyes, Todd, _please_.

> > > 3. Many people do pay a _per_minute_ connection fee.
> >
> > as myself (and thus, you (and ??) consider that i have to pay for
> > postings i do not want ??, and loose time in reading those also).
>
> Exactly my point. Your paying twice as much for each ignored reaction. Cut
> your losses and just filter/ignore the posts that don't apply to your
> situation.
>
> > If others are allowed , ....
>
> It's an ALT group. Besides, it's not like he's a brain dead troll. He's

Maybe not a brain dead troll, but WA does plenty of trolling in this group!!


> actually posting productive, educational material and solutions, that are
> batch related.

So what? Do you think WA is above and beyond following newsgroup
conventions and netiquette? Do you believe WA is superior to the rest
of us? [Earth to Todd....earth to Todd...come back.]

> Consider it like reading a book. Some people prefer to skip
> over certain chapters, while others will read the whole book even though
> their not really interested in some chapters.

All you are saying is William Allen can do whatever he pleases and no
one should ever complain about it no matter if it is inappropriate or
off topic for this group because he often posts "useful" information.


--
<!-Outsider//->
MS-DOS 6.22, Windows for Workgroups 3.11, Netscape Communicator 4.08

Todd Vargo

unread,
Dec 7, 2001, 5:47:10 PM12/7/01
to

"Outsider" <nonvali...@yahoo.com> wrote

<snip>


> > actually posting productive, educational material and solutions, that
are
> > batch related.
>
> So what? Do you think WA is above and beyond following newsgroup
> conventions and netiquette? Do you believe WA is superior to the rest
> of us? [Earth to Todd....earth to Todd...come back.]

Do you really believe all this complaining is making a difference where WA
is concerned? I don't.

> > Consider it like reading a book. Some people prefer to skip
> > over certain chapters, while others will read the whole book even though
> > their not really interested in some chapters.
>
> All you are saying is William Allen can do whatever he pleases and no
> one should ever complain about it no matter if it is inappropriate or
> off topic for this group because he often posts "useful" information.

No! All I'm saying is, you guys have already voiced your opinion to him over
and over. Speaking for myself, complaining any further at this point, and to
the same person, is just wasted bandwidth.

--

Rik D'haveloose

unread,
Dec 9, 2001, 4:55:27 PM12/9/01
to
Todd Vargo wrote

> Speaking for myself, complaining any further at this point, and to
> the same person, is just wasted bandwidth.

and this is something, imho, which says it all.
I leave the thinking to anyone (incl.WA) willing to do some.

--
TUF Greetings from Rumbeke
Belgium


Outsider

unread,
Dec 12, 2001, 1:52:40 AM12/12/01
to
Rik D'haveloose wrote:
>
> Todd Vargo wrote
> > Speaking for myself, complaining any further at this point, and to
> > the same person, is just wasted bandwidth.
>
> and this is something, imho, which says it all.
> I leave the thinking to anyone (incl.WA) willing to do some.
>
> --

For the Hopi (Native Americans), this is the time of the two worlds.
A time when there are those who continue to support destruction and
the illusion of control and those who attempt to live in harmony on
earth.

0 new messages