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

How to write a Loop in Batch?

2,099 views
Skip to first unread message

Davy

unread,
Apr 15, 2005, 11:00:50 PM4/15/05
to
Hello all,

I want to write a loop in Batch, the idea was written in C.
//------------------------
for(par0=0.1;par0<1;par0=par0+0.1) {
command1 par0 par1;
command2 par0 par2;
command3 par0 par3;
}
//------------------------

//the par is parameter for command

How to change it to Batch(I use NT), thanks!

Regards,
Davy

Timo Salmi

unread,
Apr 15, 2005, 11:35:22 PM4/15/05
to
Davy wrote:
> for(par0=0.1;par0<1;par0=par0+0.1) {
> command1 par0 par1;
> command2 par0 par2;
> command3 par0 par3;
> How to change it to Batch(I use NT), thanks!

A good starting point is
FOR /?
In this case in particular
FOR /L %variable IN (start,step,end) DO command [command-parameters]
That is for the NT/2000/XP CMD.EXE line. You'll might need
subroutines for the call (depending on their nature). Then things can
get tricky. For some examples see e.g.

115380 Mar 30 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

A caveat: The answer above is for XP. Some features of XP CMD.EXE
are not present in NT.

For getting to know batches and scripts you might also find the
following further links of use
http://www.uwasa.fi/~ts/http/http2.html#cmdscript
http://www.uwasa.fi/~ts/http/http2.html#batch
news:alt.msdos.batch.nt

In the MS-DOS+Win../95/98/Me COMMAND.COM line, incidentally, the task
is very tricky. Those interested might find e.g. the examples in the
following of some use

3) Is it possible to nest for loops in batch files?
250909 Oct 12 2005 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi

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

billious

unread,
Apr 15, 2005, 11:52:16 PM4/15/05
to

"Davy" <zhus...@gmail.com> wrote in message
news:1113620450.1...@f14g2000cwb.googlegroups.com...

Hmmm...why do C programmers seem to believe that everyone reads C :)

Your question is probably better placed in the alt.msdos.batch.nt group, but
still...

Try using the

FOR/?|more

command from the DOS prompt for docco on FOR (the |MORE allows you to read
it page-by-page)

I'd suggest

for /L %%i in (1,1,9) do command1 0.%%i par1 & command2 0.%%i par2 &
command3 0.%%i par3

would do the job - WITHIN a batch file. If executed from the command line,
change each %% to %

Now if you want a batch file which you feed with your three parameters par1
par2 and par3 then

---- cprog.bat begins

@echo off
for /L %%i in (1,1,9) do command1 0.%%i %1 & command2 0.%%i %2 & command3
0.%%i %3

---- cprog.bat ends

which you would execute as

CPROG par1 par2 par3


(This assumes that the C-hieroglyphics you've posted means
FOR A in 0 to 0.9 step 0.1 .....)

HTH

...Bill


billious

unread,
Apr 16, 2005, 12:05:29 AM4/16/05
to
...Make that (1,1,9) (0,1,9)
..You knew that....


Norman L. DeForest

unread,
Apr 16, 2005, 1:37:46 AM4/16/05
to

On Sat, 16 Apr 2005, Timo Salmi wrote:

> Davy wrote:
> > for(par0=0.1;par0<1;par0=par0+0.1) {
> > command1 par0 par1;
> > command2 par0 par2;
> > command3 par0 par3;
> > How to change it to Batch(I use NT), thanks!
>
> A good starting point is
> FOR /?
> In this case in particular
> FOR /L %variable IN (start,step,end) DO command [command-parameters]
> That is for the NT/2000/XP CMD.EXE line. You'll might need
> subroutines for the call (depending on their nature). Then things can
> get tricky. For some examples see e.g.
>
> 115380 Mar 30 2005 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
> tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi
>
> A caveat: The answer above is for XP. Some features of XP CMD.EXE
> are not present in NT.
>
> For getting to know batches and scripts you might also find the
> following further links of use
> http://www.uwasa.fi/~ts/http/http2.html#cmdscript
> http://www.uwasa.fi/~ts/http/http2.html#batch
> news:alt.msdos.batch.nt
>
> In the MS-DOS+Win../95/98/Me COMMAND.COM line, incidentally, the task

> is very tricky. [...]

What's tricky about downloading 4DOS and using that instead of
COMMAND.COM? :)

> [...] Those interested might find e.g. the examples in the


> following of some use
>
> 3) Is it possible to nest for loops in batch files?
> 250909 Oct 12 2005 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
> tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi

Downloaded and to be looked at when I have enough time.

--
">> consider moving away from Front Page...."
">To what? Any suggestions?"
"Naked bungee-jumping. It's less humiliating <g>"
-- Matt Probert in alt.www.webmaster, March 20, 2005

William Allen

unread,
Apr 16, 2005, 2:04:02 AM4/16/05
to
"Davy" wrote in message

You can use the (more elementary) FOR statement in NT
to achieve something similar. Note that (unlike Win2000)
you don't have SET /a(arithmetic) so the demo below merely
lists the (first decimal places) literally and calls the LOOP
each time. In the LOOP the digit(n) passed to it in %1 parameter
is expanded to 0.%1 = 0.n to achieve your non-integer result.

In the demo, the commands are ECHO/{demo}-ed in an inactive
form. Remove the ECHO/{demo} where shown to activate them:

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
@ECHO OFF
FOR %%J IN (1 2 3 4 5 6 7 8 9) DO CALL :LOOP %%J
GOTO :EOF

:LOOP
:: ECHO commands as a demo of loop
:: Note that counter is passed to loop as %1 parameter
:: Remove the ECHO/{demo} to activate commands
ECHO/{demo}command1 0.%1 par1
ECHO/{demo}command2 0.%1 par2
ECHO/{demo}command3 0.%1 par3

====End cut-and-paste (omit this line)
Simulated Win2000 for study/demo use. Cut-and-paste as Batch text file.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

This screen capture shows operation. Remember to
remove the ECHO/{demo} to have the commands executed
instead of merely displayed to screen:

============Screen capture Windows 2000 simulated in Win95
C:\WORK>demo.bat
{demo}command1 0.1 par1
{demo}command2 0.1 par2
{demo}command3 0.1 par3
{demo}command1 0.2 par1
{demo}command2 0.2 par2
{demo}command3 0.2 par3
{demo}command1 0.3 par1
{demo}command2 0.3 par2
{demo}command3 0.3 par3
{demo}command1 0.4 par1
{demo}command2 0.4 par2
{demo}command3 0.4 par3
{demo}command1 0.5 par1
{demo}command2 0.5 par2
{demo}command3 0.5 par3
{demo}command1 0.6 par1
{demo}command2 0.6 par2
{demo}command3 0.6 par3
{demo}command1 0.7 par1
{demo}command2 0.7 par2
{demo}command3 0.7 par3
{demo}command1 0.8 par1
{demo}command2 0.8 par2
{demo}command3 0.8 par3
{demo}command1 0.9 par1
{demo}command2 0.9 par2
{demo}command3 0.9 par3

C:\WORK>
============End screen capture

--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
Header email is rarely checked. Contact us at http://www.allenware.com/


Timo Salmi

unread,
Apr 16, 2005, 3:05:34 AM4/16/05
to
Norman L. DeForest wrote:
> On Sat, 16 Apr 2005, Timo Salmi wrote:
>>Davy wrote:
>>>for(par0=0.1;par0<1;par0=par0+0.1) {
>>> command1 par0 par1;
>>> command2 par0 par2;
>>> command3 par0 par3;

>>In the MS-DOS+Win../95/98/Me COMMAND.COM line, incidentally, the task
>>is very tricky. [...]

> What's tricky about downloading 4DOS and using that instead of
> COMMAND.COM? :)

That, as well alternatively utilizing other additional tools, definitely
is a good option to proceed. In the OP's case perhaps the method most
suitable would be GnuAWK. Not because I often use it myself, but in
this case detachedly because he is programing in C. The two are very
close each other, if not practically equivalent in many respects.

Anyway, 4DOS is free in the case of MS-DOS+Win../95/98/Me, but
not (yet?) in the case of NT/2000/XP. GAWK is free throughout the
gamut.

If a reader is interested in 4DOS, one central link is
http://www.4dos.info/

If one is interested in GAWK, under MS-DOS I would recommend
233923 Mar 25 1995 ftp://garbo.uwasa.fi/pc/unix/gawk2156.zip
gawk2156.zip GNU awk text scanning and processing language

For the NT/2000/XP I would suggest getting
878915 2003-10-25 13:19 ftp://garbo.uwasa.fi/win95/unix/UnxUpdates.zip
UnxUpdates.zip Updates for UnxUtils GNU utilities for native Win32

I know it is a sensitive issue, so please anyone do not now take this
the wrong way. The OP would probably find it very useful to peruse
also the NT/2000/XP newsgroup, including its old postings available
e.g. at http://groups-beta.google.com/group/alt.msdos.batch.nt

Phil Robyn

unread,
Apr 16, 2005, 3:14:46 AM4/16/05
to
William Allen wrote:

>
> You can use the (more elementary) FOR statement in NT
> to achieve something similar. Note that (unlike Win2000)

> you don't have SET /a(arithmetic) ...

No, NT4.0 does indeed have 'set /a'.

--
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

William Allen

unread,
Apr 16, 2005, 4:32:02 AM4/16/05
to
"Phil Robyn" wrote in message

> William Allen wrote:
>
> >
> > You can use the (more elementary) FOR statement in NT
> > to achieve something similar. Note that (unlike Win2000)
> > you don't have SET /a(arithmetic) ...
>
> No, NT4.0 does indeed have 'set /a'.

Thanks for the pointer, Phil. With SET /a integer arithmetic
the loop can be made more general:

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
@ECHO OFF

:: Initialise integer loop variable
SET J=1

:LOOP
:: ECHO commands as a demo of loop

ECHO/{demo}command1 0.%J% par1
ECHO/{demo}command2 0.%J% par2
ECHO/{demo}command3 0.%J% par3

:: Bump J and test less than 10
SET /a J=%J%+1
IF %J% LSS 10 GOTO LOOP

====End cut-and-paste (omit this line)
Simulated Win2000 for study/demo use. Cut-and-paste as Batch text file.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

This is preferable to my previous demo, since it's easily
extended to make far more loops.

William Allen

unread,
Apr 16, 2005, 5:12:51 AM4/16/05
to
"Timo Salmi" wrote in message
> Norman L. DeForest wrote:
...snip

> > What's tricky about downloading 4DOS and using that instead of
> > COMMAND.COM? :)
...snip

In my view, Timo Salmi is right to point out that this is tricky in
Windows 95/98/ME (see below for comments on 4Dos).

The actual posted C loop can easily be handled with a simple
FOR 1 2 3 4 5 6 7 8 9 loop and a Subroutine recall in Windows
95/98/ME along the lines of the first example I posted.

However, the more general case of looping (even where the STEP is
simple, say a +/-power of ten), needs something like the DigitStop
deeply recursive FOR 1 2 3 4 5 6 7 8 9 loop. And it would be fair
to say many people find this tricky to follow, and to amend for
different START STEP STOP values. For example, to handle the
OPs problem in Windows 95/98/ME with a .01 step, from .01 to .99
this is the typical syntax:

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
@ECHO OFF

IF (GOTO:)==(%1) %1%2 {Subroutine-Handler}

SET START=01
SET STOP=99
CALL %0 GOTO: _DGSTOP
SET COUNT=

GOTO EOF {=Subroutine-section-below=}
:_DGSTOP (Usage: CALL %0 GOTO: _DGSTOP)
IF (%STOP%)==() GOTO EOF
IF NOT ()==(%4) GOTO 1_DGSTOP
FOR %%D IN (0 1 2 3 4 5 6 7 8 9) DO CALL %0 GOTO: _DGSTOP %3 %%D
GOTO EOF
:1_DGSTOP
SET COUNT=%3%4
IF (%COUNT%)==(%START%) SET START=
IF NOT (%START%)==() GOTO EOF

:: ECHO commands as a demo of loop

ECHO/{demo}command1 0.%COUNT% par1
ECHO/{demo}command2 0.%COUNT% par2
ECHO/{demo}command3 0.%COUNT% par3

IF (%STOP%)==(%COUNT%) SET STOP=

:EOF {End-of-file}

====End cut-and-paste (omit this line)

For Win95/98/ME study/demo use. Cut-and-paste as plain-text Batch file.

(repeat)Norman L. DeForest> > What's tricky about downloading 4DOS and using that instead of
(repeat)Norman L. DeForest> > COMMAND.COM? :)

As to 4Dos, now it's free, it's obviously attractive to Windows 95/98/ME
users. However your point would have been better made by:
(1) Showing a 4Dos solution
(2) Explaining how to install 4Dos without having to use it instead
of COMMAND.COM (in case someone preferring your solution doesn't
want to change any key components merely to solve one problem)

Presenting the 4Dos alternative as if it _requires_ replacing key
components (such as the command interpreter) makes the 4Dos
alternative seem less desirable - I assume that's not the intention.

Full details of where to get 4Dos and how to obtain our 4Dos Guide to
Installing it in Windows 95/98/ME without affecting any other operations
outside your Custom 4Dos window is available from the links in:
http://www.allenware.com/mcsw/bus.htm#ThirdParty

(Quoted from our 4Dos Guide):
You can read further installation information that will be useful
as you become more committed to 4Dos at Klaus Meinhard's Website:
http://www.4dos.info/4dinstfq.htm

TS> The OP would probably find it very useful to peruse
TS> also the NT/2000/XP newsgroup, including its old postings available
TS> e.g. at http://groups-beta.google.com/group/alt.msdos.batch.nt
...snip

Good suggestion, particularly since similar problems have come up in
alt.msdos.batch.nt - that's why I, too (via my UsualSuspects link),
suggested this:
"The NewsGroups microsoft.public.win2000.cmdprompt.admin and
alt.msdos.batch.nt specialise in detailed Windows NT/2000/XP discussions."
(quote from first item on UsualSuspects page)

Klaus Meinhard

unread,
Apr 16, 2005, 6:07:18 AM4/16/05
to
William Allen wrote:

> (1) Showing a 4Dos solution

How about the

DO (with several possible parameters, comparisons etc.)
some command(s)
ENDDO

command? It's the most versatile. Of course there's FOR, too, for those
who are more accustomed to that. GOSUB might be mentioned in this
context.

> (2) Explaining how to install 4Dos without having to use it instead
> of COMMAND.COM (in case someone preferring your solution doesn't
> want to change any key components merely to solve one problem)

See William's and my 4DOS installation articles, both available from my
http://www.4dos.info/4docs.htm page.


--
* Klaus Meinhard *
www.4dos.info
- 4DOS Info -
- Info for DOS -


Klaus Meinhard

unread,
Apr 16, 2005, 6:28:39 AM4/16/05
to
Timo Salmi wrote:

>> What's tricky about downloading 4DOS and using that instead of
>> COMMAND.COM? :)

> That, as well alternatively utilizing other additional tools,
> definitely is a good option to proceed. In the OP's case perhaps the
> method most suitable would be GnuAWK. Not because I often use it
> myself, but in this case detachedly because he is programing in C.
> The two are very close each other, if not practically equivalent in
> many respects.

I might point out that this highlights exactly a point I have made in
the past:

solutions offered here tend to use no, if at all possible, or the
"smallest" possible external utility. This is undoubtfully a virtue from
one
point of view, or even an art. :-)

The result, however, if you try to use batch regularly, is that you need
another external proggy for the next problem, a third for the following,
and so on, until you have a whole directory full of differntly written
tools, all with different syntax, all with help of varying quality, and
all totally unintuitiv.

Installing 4DOS (and that means, in it's simplest version, nothing more
than putting the files in one dir and adding that dir to the path
statement) gives you hundreds of new commands, internal variables,
functions, especially for date and string manipulations, plus better
mostly everything else. You can write understandable code, without
nearly (see note) all of these external tools. So, for a power user, the
use of 4DOS is much more economic.

Note: External utils I use are better filters than those included in
MS-DOS: e.g. RPSORT. Buergh's LIST.COM I use regularly (though I have
written a amazingly capable replacement in 4DOS Batch), an ANSI driver
with better capabilties (I use ANSIPLUS). For extended text manipulation
a tool like AWK or SED might be better suited, though I have still to
come across a case I couldn't solve with 4DOS.

Sorry, couldn't resist ;-)

Norman L. DeForest

unread,
Apr 16, 2005, 7:07:37 AM4/16/05
to

On Sat, 16 Apr 2005, Timo Salmi wrote:

> Norman L. DeForest wrote:
> > On Sat, 16 Apr 2005, Timo Salmi wrote:
> >>Davy wrote:
> >>>for(par0=0.1;par0<1;par0=par0+0.1) {
> >>> command1 par0 par1;
> >>> command2 par0 par2;
> >>> command3 par0 par3;
>
> >>In the MS-DOS+Win../95/98/Me COMMAND.COM line, incidentally, the task
> >>is very tricky. [...]
>
> > What's tricky about downloading 4DOS and using that instead of
> > COMMAND.COM? :)
>
> That, as well alternatively utilizing other additional tools, definitely
> is a good option to proceed. In the OP's case perhaps the method most
> suitable would be GnuAWK. Not because I often use it myself, but in
> this case detachedly because he is programing in C. The two are very
> close each other, if not practically equivalent in many respects.

How different is GnuAWK from the version of awk (sorry, I have lost the
original zip file so don't know its filename) that has this in the
documentation (AWK.MAN)?

: AUTHOR
:
: Rob Duff, Vancouver, B.C., V5N 1Y9
: BBS: (604)877-7752 Fido: 1:153/713.0
:
: DATE
:
: 08-Feb-90

I have written a Never-Ending-September calendar routine that uses grep
and that version of awk in a batch file. (See sig and follow the 2nd URL
to grab a copy for yourself.)

>
> Anyway, 4DOS is free in the case of MS-DOS+Win../95/98/Me, but
> not (yet?) in the case of NT/2000/XP. GAWK is free throughout the
> gamut.

4NT is still shareware but, from what I have read, 4DOS can still be used
on NT/2000/XP for free. It just doesn't take advantage of all of the
Windows NT features or offer the same functionality as 4NT.

> If a reader is interested in 4DOS, one central link is
> http://www.4dos.info/
>
> If one is interested in GAWK, under MS-DOS I would recommend
> 233923 Mar 25 1995 ftp://garbo.uwasa.fi/pc/unix/gawk2156.zip
> gawk2156.zip GNU awk text scanning and processing language

[snip]

I'll have to try that one out and see how it differs from the version of
awk I currently have.

--
Norman De Forest http://www.chebucto.ns.ca/~af380/Profile.html
af...@chebucto.ns.ca [=||=] (A Speech Friendly Site)
My Usenet 2005 calendar: http://www.chebucto.ns.ca/~af380/Year-2005.txt
For explanation: http://www.chebucto.ns.ca/~af380/Links.Books.html#TandD

Clay Calvert

unread,
Apr 16, 2005, 7:41:33 AM4/16/05
to

Does this work right? (borrowing from William).

@ECHO OFF
for /l %%a in (0,1,9) do (
for %%b in (1 2 3) do (
ECHO/{demo}command%%b 0.%%a par%%b
)
)

To do this as one line (minus the @echo off).

for /l %%a in (0,1,9) do for %%b in (1 2 3) do ECHO/{demo}command%%b
0.%%a par%%b

Thanks

Clay Calvert
CCal...@Wanguru.com
Replace "W" with "L"

Richard Bonner

unread,
Apr 16, 2005, 8:51:30 AM4/16/05
to
Timo Salmi wrote:
> Davy wrote:
> > for(par0=0.1;par0<1;par0=par0+0.1) {
> > command1 par0 par1;
> > command2 par0 par2;
> > command3 par0 par3;
> > How to change it to Batch(I use NT), thanks!

(Snip)


> In the MS-DOS+Win../95/98/Me COMMAND.COM line, incidentally, the task
> is very tricky.

> --
> Prof. Timo Salmi

*** I may be misunderstanding this because I never learned C, but here
is the technique I use for having FOR-IN-DO run multiple commands:

IF "%1" == "*TASKS*" GOTO TASKS

FOR %%A IN ( whatever ) DO CALL 0% *TASKS* %%C
GOTO END

:TASKS
COMMAND 1 %2
COMMAND 2 %2
COMMAND 3 %2

:END


I believe this technique may have been pioneered by Kris Jamsa, but
don't quote me on that.

Apparently some newer versions of DOS allow one to run those commands
directly. 4DOS comes to mind. Does anyone know if DR-DOS 8 can do this, as
well?

Richard Bonner
http://www.chebucto.ns.ca/~ak621/DOS/

Richard Bonner

unread,
Apr 16, 2005, 9:07:12 AM4/16/05
to
Klaus Meinhard wrote:

> solutions offered here tend to use no, if at all possible, or the
> "smallest" possible external utility. This is undoubtfully a virtue from
> one point of view, or even an art. :-)

> The result, however, if you try to use batch regularly, is that you need
> another external proggy for the next problem, a third for the following,
> and so on, until you have a whole directory full of differntly written
> tools, all with different syntax, all with help of varying quality, and
> all totally unintuitiv.

(Snip "Installing 4DOS" information)

> Note: External utils I use are better filters than those included in
> MS-DOS: e.g. RPSORT. Buergh's LIST.COM I use regularly (though I have
> written a amazingly capable replacement in 4DOS Batch), an ANSI driver
> with better capabilties (I use ANSIPLUS). For extended text manipulation
> a tool like AWK or SED might be better suited, though I have still to
> come across a case I couldn't solve with 4DOS.

> Sorry, couldn't resist ;-)
> --
> * Klaus Meinhard *

*** No problem, Klaus. it seems to me that in the quest to perform
computer tasks, that we should make use of whatever can do the job. No one
system can do it all. I, and others, regularly advocate updated commands
such as XXCOPY and XSET. Others have recommend some of the UNIX
utilities which have been ported to DOS. 4DOS is an excellent update to
COMMAND.com and can solve a lot of problems.

Can much be solved with only the batch language which comes with DOS?
Yes. However, utilities and upgrades can make the job much easier and save
a lot of coding. If it's compatible with DOS, I think recommending
whatever we do gives more choices to a poster looking for a solution.

Richard Bonner
http://www.chebucto.ns.ca/~ak621/DOS/

Timo Salmi

unread,
Apr 16, 2005, 11:00:18 AM4/16/05
to
Klaus Meinhard wrote:
> Timo Salmi wrote:
>>>What's tricky about downloading 4DOS and using that instead of
>>>COMMAND.COM? :)

>>That, as well alternatively utilizing other additional tools,
>>definitely is a good option to proceed. In the OP's case perhaps the
>>method most suitable would be GnuAWK. Not because I often use it
>>myself, but in this case detachedly because he is programing in C.

> solutions offered here tend to use no, if at all possible, or the


> "smallest" possible external utility. This is undoubtfully a virtue from
> one point of view, or even an art. :-)

> The result, however, if you try to use batch regularly, is that you need
> another external proggy for the next problem, a third for the following,
> and so on, until you have a whole directory full of differntly written

It is a richness to have alternative solutions present with their pros
and cons. Personally, I've always been in favor of that kind of
diversity. It is better to have even too much than nothing.

It is obvious that there are some typical main lines adopted by the
regulars. These include e.g. (speaking now mainly of the
MS-DOS+Win../95/98/Me scene since CMD.EXE is more versatile.)

1) Pure batch. Sometimes too complicated or outright impossible,
though. One of the many masters of that approach is John Savage,
but he posts now very seldom.

2) Task-customized utilities, such as written by Kleebauer in asm
and by Stockton in TP. Both require intimate knowledge of the
programming language to write, but not to use. Difficulties may
arise if one is a system manager for a network of users. ASCII
distributuion coding has caused some discussion, but let's not
go there.

3) The 4DOS options. Usually sufficient for all upcoming tasks. You
have demonstrated that e.g. with your comparison to my MS-DOS
batch FAQ. In a network it may indeed be desirable to be able to set
it up without actually replacing COMMAND.COM.

4) AWK + SED which are very familiar to Unix users. Likewise, that's
all the additions one needs. The problem in a set of PCs is that one
must have the two available for all the relevant PCs.

5) QBASIC aided batches in the case of MS-DOS+Win../95/98/Me and WSH
aided scripts in the case of NT/2000/XP.

We all typically cover slightly different fields, which adds to the
users' options. Personally, I am by far best familiar with TP, even if I
don't use it much in here. AWK, SED, QBASIC, and WSH I use often to aid
my batches, but I am not a true specialist in any of those four.

Perhaps that about sums it up?

Ted Davis

unread,
Apr 16, 2005, 11:29:32 AM4/16/05
to

Since par1, par2, and par3 are undefined, but unlikely to be those
string literals, it would probably be better to use the original
separate line form for the commands.

--
T.E.D. (tda...@gearbox.maem.umr.edu)

Clay Calvert

unread,
Apr 16, 2005, 1:40:24 PM4/16/05
to
On Sat, 16 Apr 2005 18:00:18 +0300, Timo Salmi <t...@uwasa.fi> wrote:

>5) QBASIC aided batches in the case of MS-DOS+Win../95/98/Me and WSH
> aided scripts in the case of NT/2000/XP.

Just to note: WSH does not come with NT, however Qbasic is part of
every installation.

WSH is part of the default installation on Windows ME.

Timo Salmi

unread,
Apr 16, 2005, 5:15:10 PM4/16/05
to
William Allen wrote:
> As to 4Dos, now it's free, it's obviously attractive to Windows 95/98/ME

> (2) Explaining how to install 4Dos without having to use it instead


> of COMMAND.COM (in case someone preferring your solution doesn't

> Full details of where to get 4Dos and how to obtain our 4Dos Guide to


> Installing it in Windows 95/98/ME without affecting any other operations
> outside your Custom 4Dos window is available from the links in:
> http://www.allenware.com/mcsw/bus.htm#ThirdParty

Observations: The most important information is given, that is setting
up a separate 4DOS window. How about the additional, special case of
running a 4DOS batch within a COMMAND.COM window. That eventuality is
not covered? If appropriate, a separate note text file within
4dosguide.zip might be of interest to some of the users.

It is true that the information is given for 95/98/ME where long
file names are supported. However, given the rare 8+3 eventuality
4dosguide.zip however counts to 9+3.

William Allen

unread,
Apr 16, 2005, 6:22:04 PM4/16/05
to
"Timo Salmi" wrote in message
> William Allen wrote:
> > As to 4Dos, now it's free, it's obviously attractive to Windows 95/98/ME
>
> > (2) Explaining how to install 4Dos without having to use it instead
> > of COMMAND.COM (in case someone preferring your solution doesn't
>
> > Full details of where to get 4Dos and how to obtain our 4Dos Guide to
> > Installing it in Windows 95/98/ME without affecting any other operations
> > outside your Custom 4Dos window is available from the links in:
> > http://www.allenware.com/mcsw/bus.htm#ThirdParty
>
> Observations: The most important information is given, that is setting
> up a separate 4DOS window. How about the additional, special case of
> running a 4DOS batch within a COMMAND.COM window. That eventuality is
> not covered? If appropriate, a separate note text file within
> 4dosguide.zip might be of interest to some of the users.

There is already a note in the current version of our 4Dos Guide
about using 4Dos Batch files from the normal COMMAND.COM
prompt, including how to use a DosKey macro to simplify running
4Dos from a standard COMMAND.COM window:

******Quoted from current version of our 4Dos Guide
This example shows a Doskey macro in use to run a 4Dos Batch file
from the ordinary MS-DOS command prompt in Windows 95 (here we've
just loaded the DosKey macro temporarily, as a demonstration):

============Screen capture Windows 95
C:\WORK>type my4dosbatch.bat
@ECHO OFF
ECHO. Use 4Dos _ENV variable as follows
ECHO. Environment space left=%_ENV%
ECHO. Parameters passed were: %1 %2 %3 (and so on)

C:\WORK>doskey run4dos=C:\OTHER\4DOS\4DOS.COM /e:4096 /c $*

C:\WORK>run4dos my4dosbatch.bat one two three
Use 4Dos _ENV variable as follows
Environment space left=3732
Parameters passed were: one two three (and so on)

C:\WORK>
============End screen capture

Remember: use your chosen path where we've used the demonstration
path: C:\OTHER\4DOS\4DOS.COM
******End Quote

The Guide explains how to find the meaning of all the terms
used in the DosKey macro line.

> It is true that the information is given for 95/98/ME where long
> file names are supported. However, given the rare 8+3 eventuality
> 4dosguide.zip however counts to 9+3.

When you click on the link on our TroubleShooter page in a normal
browser you are offered the choice to save file to disk and you can
select any name you please as well as the folder. Any user who
doesn't wish to use the default name can type another in the File,
"Save as" dialogue.

Todd Vargo

unread,
Apr 16, 2005, 10:09:44 PM4/16/05
to

"Clay Calvert" <ccal...@Wanguru.com> wrote in message
news:rhi261da6ooickebq...@4ax.com...

> On Sat, 16 Apr 2005 18:00:18 +0300, Timo Salmi <t...@uwasa.fi> wrote:
>
> >5) QBASIC aided batches in the case of MS-DOS+Win../95/98/Me and WSH
> > aided scripts in the case of NT/2000/XP.
>
> Just to note: WSH does not come with NT, however Qbasic is part of
> every installation.

You must be referring to every installation of NT as Qbasic is not part of
Windows 95/98/ME or XP installations. (I don't know about 2K or K3)

>
> WSH is part of the default installation on Windows ME.

FWIW, WSH was part of the default installation of Windows 98 and was
installed to Windows 95 with MSIE 4+ upgrade.

--
Todd Vargo (double "L" to reply by email)

Timo Salmi

unread,
Apr 16, 2005, 11:22:42 PM4/16/05
to
William Allen wrote:
> "Timo Salmi" wrote in message
>>Observations: The most important information is given, that is setting
>>up a separate 4DOS window. How about the additional, special case of
>>running a 4DOS batch within a COMMAND.COM window. That eventuality is

> There is already a note in the current version of our 4Dos Guide


> about using 4Dos Batch files from the normal COMMAND.COM
> prompt, including how to use a DosKey macro to simplify running
> 4Dos from a standard COMMAND.COM window:

The "Notes item (e)". Understood. My point here is that it might be more
obvious to some readers if presented, perhaps more separately, in the
above terms. Now it is presented as "increasing one's [subsequent]
[4DOS] commitment". Completely up to you, but as constructively meant
reader's feedback this was to suggest perhaps presenting it
(alternatively) as "running 4DOS in the standard COMMAND.COM window".
Some potential users might even wish start from that option instead of
first graduating up from the main instruction's principal 4DOS separate
box option. (The 4DOS box option being very clearly instructed.)

>>4dosguide.zip however counts to 9+3.

> select any name you please as well as the folder. Any user who


> doesn't wish to use the default name can type another in the File,
> "Save as" dialogue.

Yes, that one is an "of course". But it means that the situation
can arise. (Coming from my MS-DOS archive site maintainer's experience.)

Clay Calvert

unread,
Apr 16, 2005, 11:59:09 PM4/16/05
to
On Sat, 16 Apr 2005 13:40:24 -0400, Clay Calvert
<ccal...@Wanguru.com> wrote:

>On Sat, 16 Apr 2005 18:00:18 +0300, Timo Salmi <t...@uwasa.fi> wrote:
>
>>5) QBASIC aided batches in the case of MS-DOS+Win../95/98/Me and WSH
>> aided scripts in the case of NT/2000/XP.
>
>Just to note: WSH does not come with NT, however Qbasic is part of
>every installation.

NT does come with WSH 1.0. Sorry about that.

Todd Vargo

unread,
Apr 17, 2005, 1:29:15 AM4/17/05
to

"Clay Calvert" <ccal...@Wanguru.com> wrote in message
news:vkn361d0ecvjkaqps...@4ax.com...

> On Sat, 16 Apr 2005 13:40:24 -0400, Clay Calvert
> <ccal...@Wanguru.com> wrote:
>
> >On Sat, 16 Apr 2005 18:00:18 +0300, Timo Salmi <t...@uwasa.fi> wrote:
> >
> >>5) QBASIC aided batches in the case of MS-DOS+Win../95/98/Me and WSH
> >> aided scripts in the case of NT/2000/XP.
> >
> >Just to note: WSH does not come with NT, however Qbasic is part of
> >every installation.
>
> NT does come with WSH 1.0. Sorry about that.

Thanks Clay.

William Allen

unread,
Apr 17, 2005, 3:01:30 AM4/17/05
to
"Timo Salmi" wrote in message
...snip

> The "Notes item (e)". Understood. My point here is that it might be more
> obvious to some readers if presented, perhaps more separately, in the
> above terms. Now it is presented as "increasing one's [subsequent]
> [4DOS] commitment".
...snip

Yes, a point well made. Added to "changes to make" list for next time
the Guide goes through change control. That note needs rewriting as
a Section in its own right, and flagged from the top of the Guide.

--
William Allen


Klaus Meinhard

unread,
Apr 16, 2005, 12:35:31 PM4/16/05
to
Timo Salmi wrote:

> Perhaps that about sums it up?

Yes. No doubt others will chime in, but that's a resumé I can fully
agree with :-)

Timo Salmi

unread,
Apr 17, 2005, 4:36:07 AM4/17/05
to
William Allen wrote:
> "Timo Salmi" wrote in message
>>above terms. Now it is presented as "increasing one's [subsequent]
>>[4DOS] commitment".

> Yes, a point well made. Added to "changes to make" list for next time


> the Guide goes through change control. That note needs rewriting as
> a Section in its own right, and flagged from the top of the Guide.

The DOSKEY approach is a good one. There might also be an alternative
way. That is putting it all, without the DOSKEY definition into a
COMMAND.COM batch file to be then run with 4DOS. I have the feeling that
at least the same recursive method should apply as I (and many others)
have used e.g. for QBASIC and GAWK aided COMMAND.COM batches. Perhaps
I'll tinker with it, time allowing, sometime in the future and consider
a complementary TSBAT FAQ item
165) How do I make my COMMAND.COM batch run with 4DOS stand-alone?

Message has been deleted

Klaus Meinhard

unread,
Apr 17, 2005, 5:18:29 AM4/17/05
to
William Allen wrote:

> Yes, a point well made. Added to "changes to make" list for next time
> the Guide goes through change control. That note needs rewriting as
> a Section in its own right, and flagged from the top of the Guide.

Let's not forget the simplest method: Install 4DOS in a separate
directory (not really essential, but it keeps things orderly. You could
choose any other dir in your path and forget about the next step.), add
that directory's name to the path statement, and then (after rebooting)
you can simply type 4DOS at any prompt and you will be in 4DOS :-) Type
exit to return to command.com prompt.

To start a 4DOS batch from command.com start 4DOS with the b atch name
and path, e.g.

4DOS /C c:\belfry\mybatch

You can even set an exit code that can be read from command.com as
errorlevel

Norman L. DeForest

unread,
Apr 17, 2005, 6:53:04 AM4/17/05
to

If you are referring to a *.exe file, it must have been deleted from my
Windows 98 PC before it was given to me or must have never been installed.
I can't even find it in the *.CAB files in the C:\WIN98 directory:

I can find no wsh.exe file on my machine. I can find associated files
(*.dll, *.vxd, etc.) but no executable by that name. A grep for
"[Ww][Ss][Hh]" in my listing of *.CAB contents finds six entries:

DRIVER12.CAB:
mwshdw.dll Application Extension 14752 2002-04-17 10:22:15 AM 14752 100 FFFFFF
DRIVER20.CAB:
mwshdw.mws MWS File 26304 2002-04-17 10:25:00 AM 26304 100 FFFFFF
NET10.CAB:
wshtcp.vxd Virtual device driver 9917 2002-04-17 10:25:47 AM 9917 100 FFFFFF
PRECOPY2.CAB:
wsh.inf Setup Information 10528 2002-04-17 10:27:06 AM 10528 100 FFFFFF
WIN98_59.CAB:
wshext.dll Application Extension 73728 2002-04-17 10:48:17 AM 73728 100 FFFFFF
WIN98_63.CAB:
wshom.ocx OCX File 132368 2002-04-17 10:49:18 AM 132368 100 FFFFFF

Because of the WSH vulnerabilities I have heard about being exploited by
trojans and worms, I'm not even sure if I would want it on my machine.

What could I do with it that couldn't be done with an appropriate batch
file and a DOS utility (from elsewhere or written by myself) or a
GW-BASIC routine?

--
">> consider moving away from Front Page...."
">To what? Any suggestions?"
"Naked bungee-jumping. It's less humiliating <g>"
-- Matt Probert in alt.www.webmaster, March 20, 2005

Klaus Meinhard

unread,
Apr 17, 2005, 6:54:25 AM4/17/05
to
William Allen wrote:

William,

> (2) Once the 4dos.com component is itself downloaded, the Batch
> file recalls itself in a 4dos.com /c child shell to complete the
> installation using 4Dos syntax to ask the user various questions
> about where and how he/she wants the files located.

for a few ideas what is possible in a 4dos installation script take a
look at the 4XBTM installation batch. 4XBTM is the name of my old 4DOS
batch collection available at my site (see sig).

foxidrive

unread,
Apr 17, 2005, 8:02:49 AM4/17/05
to
On Sun, 17 Apr 2005 07:53:04 -0300, Norman L. DeForest wrote:

> On Sat, 16 Apr 2005, Todd Vargo wrote:
>
>> FWIW, WSH was part of the default installation of Windows 98 and was
>> installed to Windows 95 with MSIE 4+ upgrade.

> If you are referring to a *.exe file, it must have been deleted from my
> Windows 98 PC before it was given to me or must have never been installed.
> I can't even find it in the *.CAB files in the C:\WIN98 directory:

cscript.exe and wscript.exe

Richard Bonner

unread,
Apr 17, 2005, 9:23:52 AM4/17/05
to
Timo Salmi wrote:
> William Allen wrote:
> > "Timo Salmi" wrote in message
> >>Observations: The most important information is given, that is setting
> >>up a separate 4DOS window. How about the additional, special case of
> >>running a 4DOS batch within a COMMAND.COM window?

> > There is already a note in the current version of our 4Dos Guide
> > about using 4Dos Batch files from the normal COMMAND.COM
> > prompt, including how to use a DosKey macro to simplify running
> > 4Dos from a standard COMMAND.COM window:

> The "Notes item (e)". Understood. My point here is that it might be more
> obvious to some readers if presented, perhaps more separately, in the
> above terms. Now it is presented as "increasing one's [subsequent]
> [4DOS] commitment". Completely up to you, but as constructively meant
> reader's feedback this was to suggest perhaps presenting it
> (alternatively) as "running 4DOS in the standard COMMAND.COM window".
> Some potential users might even wish start from that option instead of
> first graduating up from the main instruction's principal 4DOS separate
> box option.

>--
> Prof. Timo Salmi

*** I have done this. I wrote a short batch file which is similar to
William's DOSKEY macro back when I had NDOS. I have switched to 4DOS,
now. The batch file runs 4DOS as a secondary shell, completes the task,
and exits to COMMAND.com. This allows me to have the features of 4DOS but
without disrupting the COMMAND.com setup. Unfortunately, there is a slight
delay when using this method.

I will eventually switch this so that 4DOS is the primary and
COMMAND.com is the secondary. However, it will mean a lot of re-writing
of many batch files first. )-:

Richard Bonner
http://www.chebucto.ns.ca/~ak621/DOS/

Message has been deleted

Todd Vargo

unread,
Apr 17, 2005, 10:46:39 AM4/17/05
to

"Norman L. DeForest" wrote:
> If you are referring to a *.exe file, it must have been deleted from my
> Windows 98 PC before it was given to me or must have never been installed.
> I can't even find it in the *.CAB files in the C:\WIN98 directory:
>
> I can find no wsh.exe file on my machine. I can find associated files
> (*.dll, *.vxd, etc.) but no executable by that name.

As foxidrive points out, cscript.exe and wscript.exe are the host engines of
the VBScript and JScript languages.

cscript.exe is the host engine for command line use.
wscript.exe is used by default and while it can be used from the command
line, it's purpose is for when a batch is not needed.


> Because of the WSH vulnerabilities I have heard about being exploited by
> trojans and worms, I'm not even sure if I would want it on my machine.

No problem, readers objecting to WSH use can simply pass on any suggested
code that uses it, or if they have already removed it from their machines.
The point is, since WSH is already installed on default installations of
Win98 and newer, why not teach people to make good use of it. There have
been suggestions in WSH groups for keeping it away from the hands of malware
engineers but I'll leave the details of that to the WSH groups to explain.

>
> What could I do with it that couldn't be done with an appropriate batch
> file and a DOS utility (from elsewhere or written by myself) or a
> GW-BASIC routine?

I do not suggest you replace your existing utilities or batch files with
WSH, rather, compliment what you already know with it. For those who have no
prior knowledge of GW-BASIC (or DOS utilities), WSH is a better suggestion
for newcomers to begin learning because it handles file and string
manipulation, LFN's, and the registry intrinsically, and it's already
installed in most cases.

Timo Salmi

unread,
Apr 17, 2005, 12:31:47 PM4/17/05
to
William Allen wrote:
> "Timo Salmi" wrote in message
>>It is true that the information is given for 95/98/ME where long
>>file names are supported. However, given the rare 8+3 eventuality
>>4dosguide.zip however counts to 9+3.

> When you click on the link on our TroubleShooter page in a normal
> browser you are offered the choice to save file to disk and you can
> select any name you please as well as the folder. Any user who

Let me still elaborate on this of my comments. What you say works under
long-name supporting systems, which of course is crucial. However,
problems will be caused on unzipping on very old systems because
_within_ the package there is a 9+3 filename 4dosguide.txt. No big deal,
but that, rather than the actual package name will be a problem on the
very old systems. E.g. the old SHEZ archiver shell would fail to extract
that particular file. Even in this day and age someone might wish to
enhance his/her straight MS-DOS.

Timo Salmi

unread,
Apr 17, 2005, 12:51:51 PM4/17/05
to
Richard Bonner wrote:
> Timo Salmi wrote:
>>William Allen wrote:
(snip)

>>>>Observations: The most important information is given, that is setting
>>>>up a separate 4DOS window. How about the additional, special case of
>>(alternatively) as "running 4DOS in the standard COMMAND.COM window".

>>Some potential users might even wish start from that option instead of
>>first graduating up from the main instruction's principal 4DOS separate
>>box option.

> *** I have done this. I wrote a short batch file which is similar to


> William's DOSKEY macro back when I had NDOS. I have switched to 4DOS,
> now. The batch file runs 4DOS as a secondary shell, completes the task,
> and exits to COMMAND.com. This allows me to have the features of 4DOS but
> without disrupting the COMMAND.com setup. Unfortunately, there is a slight
> delay when using this method.

I already set up a 4dos box on a W95. That turned out to be very easy to
do, mostly along the lines provided by William Allen and Klaus Meinhard.
I did some tweaking of my own, though, in setting it up. In calling 4dos
I included in the desktop item properties a batch file to customize the
contents of the window. Most importantly I use ANSI to change the screen
colors, since my old W95 monitor is too dim for the default colors. I
prefer bright yellow or similar to see properly. It also allows This is
an idea which I have used since many years back in the W95 command.com
dosbox. Probably that is not the only way, but I have not looked at 4DOS
further options yet.

It will be interesting to experiment further, in particular to hopefully
arrive at a
165) How do I write 4DOS-aided batch files under COMMAND.COM?
Your feedback and the earlier information provided tells that it is
feasible. It also well befits the general idea of batch programming.

Message has been deleted

William Allen

unread,
Apr 17, 2005, 1:16:19 PM4/17/05
to
"Norman L. DeForest" wrote in message
...snip

> If you are referring to a *.exe file, it must have been deleted from my
> Windows 98 PC before it was given to me or must have never been installed.
> I can't even find it in the *.CAB files in the C:\WIN98 directory:
>
> I can find no wsh.exe file on my machine. I can find associated files
> (*.dll, *.vxd, etc.) but no executable by that name. A grep for
> "[Ww][Ss][Hh]" in my listing of *.CAB contents finds six entries:

Create text file called DEMO.VBS which contains one line of text:

WScript.Echo WScript.Version

Look at the file in Windows Explorer. If it has an icon that looks
like a green S-shaped scroll of paper with lines across it on a
white background, then you have WSH installed. Double-click
the file in Explorer and a pop-up box will tell you what version
of WSH you currently have

The key executables for WSH are:
(1) GUI use: WSCRIPT.EXE (ECHO-s output to a pop-up box)
(2) Command line use: CSCRIPT.EXE (ECHO-s output to STDOUT)

Windows Script Host full details: http://msdn.microsoft.com/scripting/

Timo Salmi

unread,
Apr 17, 2005, 3:48:44 PM4/17/05
to
DRAFT

165. How do I write 4DOS-aided batch files in a COMMAND.COM window?

The following batch demonstrates how to run 4DOS-aided batches in
conventional MS-DOS or in a COMMAND.COM based dosbox without
replacing COMMAND.COM with 4DOS.COM as the system's command
processor. This gives added flexibility for the quite limited
capabilities of COMMAND.COM in the same way as Gnu(AWK), SED, or
QBASIC can be used to enhance the lagacy batch solutions.

@echo off
::
:: Point to 4DOS
set fourpath=L:\4DOSHOME
set path_=%path%
if not exist %fourpath%\4dos.com goto _nofind4
set path=%fourpath%;%path%
::
:: Demonstrate building and running a 4DOS batch in a command.com window
:: Build (very simple, but requires 4DOS)
> %temp%\4temp.btm echo @echo off
>> %temp%\4temp.btm echo echo Demonstrating a 4DOS directory listing
>> %temp%\4temp.btm echo dir /2 /k /b %fourpath%
>> %temp%\4temp.btm echo.
>> %temp%\4temp.btm echo echo Demonstrating 4DOS function evaluation
>> %temp%\4temp.btm echo set i=%%@eval[4/7]
>> %temp%\4temp.btm echo echo %%i%%
:: Run
4dos /e:4096 /c %temp%\4temp.btm
:: Exit
goto _cleanup
::
:_nofind4
echo.
echo Exiting: 4DOS.COM is not available
echo.
echo You need to have the following files at %fourpath%
echo 4DOS.COM
echo 4DOS.HLP
echo 4DOS.ICO (optional)
echo 4HELP.EXE
echo Free from http://www.jpsoft.com/download.htm
goto _cleanup
::
:_cleanup
set path=%path_%
for %%f in (%temp%\4temp.btm) do if exist %%f del %%f
for %%v in (fourpath path_) do set %%v=

The output will be e.g.
D:\TEST>batfaq
Demonstrating a 4DOS directory listing
4DOS.COM 4DOS.HLP
4DOS.ICO 4DOS.ZIP
4DOSGUID.TXT 4DOSGUID.ZIP
4DREADME.TXT 4HELP.EXE
Demonstrating 4DOS function evaluation
0,5714285714

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 batch files and tricks ftp://garbo.uwasa.fi/pc/link/tsbat.zip

Dr John Stockton

unread,
Apr 17, 2005, 2:53:23 PM4/17/05
to
JRS: In article <1113620450.1...@f14g2000cwb.googlegroups.com>,
dated Fri, 15 Apr 2005 20:00:50, seen in news:alt.msdos.batch, Davy
<zhus...@gmail.com> posted :

>I want to write a loop in Batch, the idea was written in C.
>//------------------------
>for(par0=0.1;par0<1;par0=par0+0.1) {

Since 0.1 cannot be represented exactly as a binary float, par) will not
be exactly 0.1 - 0.9 and in particular it may take a tenth value nearly
1.0 with that code. It is rarely wise to take floats as exact.

> command1 par0 par1;
> command2 par0 par2;
> command3 par0 par3;
>}
>//------------------------
>
>//the par is parameter for command
>
>How to change it to Batch(I use NT), thanks!

You should have used news:alt.msdos.batch.nt; this newsgroup was
created for DOS-compatible batch (now DOS..Win98/ME) whereas that
one was created for enhanced batch, and is used by a substantially
greater number of experts in your sort of operating system.


For loops with a simple arithmetic relationship relating the different
passes, it can be easy enough to unroll the loop, and to generate the loop
from parameterisable code. A moderately long intermediate file is not a
great disadvantage, and there is the benefit that one can readily see what
will happen when it runs.

echo.| COLS !9-1 | COLS ^1,1 | COLS 'command 1 * '0. 1 * 'par 1 ';
-> command1 0.1 par1;
command2 0.2 par2;
command3 0.3 par3;
command4 0.4 par4;
command5 0.5 par5;
command6 0.6 par6;
command7 0.7 par7;
command8 0.8 par8;
command9 0.9 par9;

Generate a line; for each line, generate 8 more; on each line, write a
number in column 1; for each line, generate a longer line using column 1
three times.

That is not limited to 9 lines, though for more one would do it a little
differently. COLS via below.

--
© 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.

Klaus Meinhard

unread,
Apr 17, 2005, 5:02:04 PM4/17/05
to
William Allen wrote:

> I expect we'll make the change when I rewrite the Guide note
> on COMMAND.COM DosKey use of 4Dos. For administrative
> reasons we'll probably make the 8.3 ZIPname reflect the version
> of the Guide, too. Thanks for making the further point about
> the internal name.

It would be much better IMO if you kept a consistent name to allow a
link to your guide without the need to constant updating.

IIRC you don't mention the advisabilty to use the .BTM extension for
4DOS batches. 4DOS at it's best with .BTM files (Batch To Memory - the
whole batch file is loaded into memory and executed, while command.com
loads only 1 line, executes it, loads the next line etc. This behaviour
is copied by 4DOS with batch files until told otherwise by the LOADBTM
command). It's easier on the user too: no frustration by trying to
execute a 4dos batch with lame command.com :-)

Klaus Meinhard

unread,
Apr 17, 2005, 5:23:05 PM4/17/05
to
Timo Salmi wrote:

I am very happy to find many of you experimenting with 4DOS :-)

Some comments: you might want to take a look at the OPTION command's
possibilities (or the various 4DOS.INI directives, which are manipulated
whith OPTION):

> @echo off

To avoid the repetition of this line in every batch, set BATCHECHO=NO in
4DOS.INI or use the interactive OPTION - Configure - Options 1 page to
the same effect. 4DOS contains e very effective debugger which can be
invoked with a SETDOS /Y1 at the beginning (or any other place) of a
batch.

> set path=%fourpath%;%path%

Just a pointer to the ESET command: you can edit any var on the command
line with this.

> 4dos /e:4096 /c %temp%\4temp.btm

The size of the environment is much better set in 4DOS.INI
(ENVIRONMENT=nnnn, OPTION- Startup). See also the various UMB
directives: you can load nearly all of 4DOS into UMB if you have enough
free, so even a second shell (as you intend to use 4DOS) has enough of
the precious DOS memory.

HTH.

Klaus Meinhard

unread,
Apr 17, 2005, 5:05:35 PM4/17/05
to
Timo Salmi wrote:

> properly. It also allows This is an idea which I have used since many
> years back in the W95 command.com dosbox. Probably that is not the
> only way, but I have not looked at 4DOS further options yet.

Sorry, I think somethings missing here or I am too dense. Could you
elaborate?

Timo Salmi

unread,
Apr 17, 2005, 5:34:30 PM4/17/05
to
Klaus Meinhard wrote:

> Timo Salmi wrote:
>>properly. It also allows This is an idea which I have used since many
>>years back in the W95 command.com dosbox. Probably that is not the
>>only way, but I have not looked at 4DOS further options yet.

> Sorry, I think somethings missing here or I am too dense. Could you
> elaborate?

After posting the DRAFT 165 item my above comment is moot, and can thus
be skipped.

Message has been deleted

Timo Salmi

unread,
Apr 17, 2005, 6:11:39 PM4/17/05
to
Timo Salmi wrote:
> Klaus Meinhard wrote:
>> Timo Salmi wrote:
>>
>>> It also allows This is an idea which I have used since many
>>> years back in the W95 command.com dosbox. Probably that is not the
>>> only way, but I have not looked at 4DOS further options yet.

>> Sorry, I think somethings missing here or I am too dense. Could you
>> elaborate?

> After posting the DRAFT 165 item my above comment is moot, and can thus
> be skipped.

It is late. I waas obviously not thinking clearly enough. What I should
have said is when I open the 4DOS window I have it call the following
batch which sets up some features.

@echo off
echo <esc>[40;37;1m
if exist c:\win95\ping.exe goto _4dos
echo.
echo This batch %0 is for Timo's Windows95 configuration only
echo.
pause
goto _out

:_4dos
echo <esc>[40;36;1m
cls
path
l:\4doshome;c:\win95\command;c:\win95;f:\tools;e:\arczip;f:\ftools;l:\TSEPro
goto _out

:_out
echo <esc>[40;36;1m

Perhaps, e.g. the colors could be set differently and so on. I don't
know. But that already almost transcends batches and moves into the
comp.os.msdos.4dos realm.

Richard Bonner

unread,
Apr 17, 2005, 7:46:39 PM4/17/05
to

*** First: What's with all the separate threads? Did Timo and Klaus have
news program hiccups? (-:


Klaus Meinhard wrote:
> Timo Salmi wrote:

> I am very happy to find many of you experimenting with 4DOS :-)

*** It's an excellent replacement. I would switch immediately, but too
many of my existing batch files didn't run properly. )-:


> Some comments: you might want to take a look at the OPTION command's
> possibilities (or the various 4DOS.INI directives, which are manipulated
> whith OPTION):

> > 4dos /e:4096 /c %temp%\4temp.btm

> The size of the environment is much better set in 4DOS.INI
> (ENVIRONMENT=nnnn, OPTION- Startup).

*** Is this passed on to secondary shells? One thing about COMMND.com is
that the default environment size passed to secondary shells is too small
for my purposes. I have a patch suggestion from XSET, but have never
implemented it because I don't fully understand the documentation.


> See also the various UMB
> directives: you can load nearly all of 4DOS into UMB if you have enough
> free, so even a second shell (as you intend to use 4DOS) has enough of
> the precious DOS memory.

> --
> * Klaus Meinhard *

*** I use QEMM 8.1 and have *tonnes* of lower memory, so this is rarely
a problem. Still, I must try this. What is the command line syntax for
loading 4DOS as a secondary shell and into UMBs?

Richard Bonner
http://www.chebucto.ns.ca/~ak621/DOS/

Message has been deleted

Todd Vargo

unread,
Apr 17, 2005, 8:40:41 PM4/17/05
to

"Richard Bonner" wrote:
> I will eventually switch this so that 4DOS is the primary and
> COMMAND.com is the secondary. However, it will mean a lot of re-writing
> of many batch files first. )-:

No need for rewriting your existing batches. Simply load COMMAND.COM when
needed and your code will be fine. Depending on your code, you may need to
set COMSPEC to point to COMMAND.COM when COMMAND.COM is running a certain
few batches. For this purpose, you can easily write a batch to load
COMMAND.COM and set COMSPEC and then run one of your old batches.

OTOH, there is no reason you can't keep 4DOS as a secondary command
processor to aid your batch chores.

Todd Vargo

unread,
Apr 17, 2005, 9:53:59 PM4/17/05
to

"Richard Bonner" <ak...@chebucto.ns.ca> wrote in message
news:d3usgv$1c5$2...@News.Dal.Ca...

>
> *** First: What's with all the separate threads? Did Timo and Klaus have
> news program hiccups? (-:

It appears I am not the only one seeing duplicated messages.

Timo Salmi

unread,
Apr 17, 2005, 11:51:16 PM4/17/05
to
Richard Bonner wrote:
> *** First: What's with all the separate threads? Did Timo and Klaus have
> news program hiccups? (-:

I just checked from two different newsservers using two different
newsprograms. Neither had any problems and the treads were kept intact.
Nor do I detect any duplicates, so the possible problems lie elsewhere.
Thus, in all friendliness, if you mean technical problems with my
posting you are benevolently "barking up the wrong tree". If you mean
the contents of what I say, then I am not sure what you refer to. In
that case please elaborate.

However, broken header reference chains are not unheard of. Nor are
broken newsserver situations where some IPS along the way erroneously
recycles old articles sometimes creating all kinds of programs depending
on one's particular utilities. I have seen such instances of my years on
the Usenet news.

Despite its name news:news.newusers.questions is a good place to ask
about and discuss such problems. That is because some posters with much
knowledge on these particular matters reside there.

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

Norman L. DeForest

unread,
Apr 18, 2005, 1:58:03 AM4/18/05
to

On Sun, 17 Apr 2005, Timo Salmi wrote:
[snip]
> I already set up a 4dos box on a W95. [...]
[snip]
> [...] Most importantly I use ANSI to change the screen

> colors, since my old W95 monitor is too dim for the default colors. I
> prefer bright yellow or similar to see properly. It also allows This is
> an idea which I have used since many years back in the W95 command.com
> dosbox. Probably that is not the only way, but I have not looked at 4DOS
> further options yet.
[snip]

You might want to check out the FPMAN220 package mentioned on my Computer
Tips page,
http://www.chebucto.ns.ca/~af380/Tips.html#Tip019
It includes a VGA font editor, a VGA palette editor, and a utility
for setting new fonts or palettes. You can increase the brightness
of any of the 16 colours you get.

For example, I find bright yellow on black the easiest to read for
accessing Usenet through my terminal emulator. However, while it allows
changing background and foreground colours, the terminal program has no
separate setting for reverse video. It just uses the low-intensity
version of the foreground colour for reverse-video background. That is a
dark reddish-brown on my monitor and made reverse video almost imposible
to read with my old monitor (which was probably worse than yours[1]).
Redefining the low-intensity yellow to a bright amber made reverse-video
readable again.

I have also found a TSR palette editor that allows you to change the
palette when running old DOS graphics programs. However, the default
palettes it comes with are horrible and getting a reasonable initial
palette can be a pain. When/If I can find the time, I plan on creating
a set of instructions for setting it up and initialising the palette
definitions for it to reasonable ones. When/If I get that done, you
can expect it to show up on my Computer Tips page.

[1] On a scale from 0 to 63, I had to crank blue up to 55 or higher
and red and green up to about 40 to 45 just to make them barely
visible.

Message has been deleted

Timo Salmi

unread,
Apr 18, 2005, 12:51:35 PM4/18/05
to
Klaus Meinhard wrote:
> I am very happy to find many of you experimenting with 4DOS :-)

A rewrite:

DRAFT

69. All these solutions are for wimps. Why not rather use 4DOS?

4DOS is a powerful alternative command interpreter that can be used
to replace MS-DOS COMMAND.COM. There are many tasks that can be
performed simply and effectively with it. For example, arithmetic
calculations considered earlier in this FAQ could be easily done
with EVAL instead of using the BASIC solutions of the vanilla
MS-DOS. However, changing to 4DOS also poses some inevitable
problems.
1) You have to decide whether the extra features are worth the
hassle of changing the command interpreter.
2) You have to weigh the advantages against the inconvenience of
the incompatibilities. Not only of batches rewriting, but some
programs will cease working properly if you change your command
interpreter.
Quoting Richard Bonner from news:alt.msdos.batch "It's an excellent


replacement. I would switch immediately, but too many of my existing
batch files didn't run properly."

There always are better, or just other batch solutions, which the
users of an alternative system are naturally eager to recommend to
others. It is human and rational to like the tools one is best
familiar with.
Whatever the pros and cons of 4DOS vs. COMMAND.COM, this FAQ
package was originally written for vanilla MS-DOS. It mostly does
not utilize any 4DOS additional features. They are covered elsewhere
(see the last reference). However, you might be interested to take a
look at the current FAQ's items #164 and #165 which demonstrate how
COMMAND.COM based batches can utilize 4DOS features without
replacing COMMAND.COM with 4DOS.COM as the system's principal
command processor.

References/Comments:
http://www.google.com/groups?selm=42612883$1...@news.dnainternet.net
http://www.4dos.info/4batfaq.htm

Klaus Meinhard

unread,
Apr 18, 2005, 2:15:03 AM4/18/05
to
Richard Bonner wrote:

> *** It's an excellent replacement. I would switch immediately, but
> too many of my existing batch files didn't run properly. )-:

If you'd follow my advice how to install 4dos you could switch
immediately: :BAT files would be executed by command.com, .BTM files by
4DOS...

> *** Is this passed on to secondary shells?

Yes. Each subsequent shell also reads the (optional) 4START.BTM file
(like an autoexec.bat).

> *** I use QEMM 8.1 and have *tonnes* of lower memory, so this is
> rarely a problem. Still, I must try this. What is the command line
> syntax for loading 4DOS as a secondary shell and into UMBs?

Read again the original post: use OPTION to get several (7) pages of
configurable items. On the 1st page you can tweak the size of several
buffers among them the size of the environment, the option to load them
into UMBs, and the option to keep some of them local (not for the
environment). You can also specify the minimum free env space for a new
4dos shell (on top of existing, used env space).

If you take a look afterwards into your 4DOS.INI file you'll easily see
the relevant directives, and there are a few more that are not reachable
via OPTION but are documented in the 4dos HELP system under 4DOS.INI.


Klaus Meinhard

unread,
Apr 18, 2005, 2:20:43 AM4/18/05
to
Richard Bonner wrote:

> *** First: What's with all the separate threads? Did Timo and
> Klaus have news program hiccups? (-:

Sorry? I am a bit more active at the moment, so the number of my
postings is up, but none of the threads seem to be broken, nor do I see
doubles´here. What I see, however, are some very long threads...


--
* Klaus Meinhard *

Dr John Stockton

unread,
Apr 18, 2005, 3:20:34 PM4/18/05
to
JRS: In article <4262d906$0$42323$ed26...@ptn-nntp-reader02.plus.net>,
dated Sun, 17 Apr 2005 22:44:04, seen in news:alt.msdos.batch, William
Allen <_w...@email.com> posted :
>
>"Dr John Stockton" wrote in message
>...snip

>> You should have used news:alt.msdos.batch.nt;
>
>No. You are wrong. Windows NT/2000/XP operating systems
>are on-Topic in alt.msdos.batch as parent. Therefore, there is

Quoting half of such a sentence is a childish tactic, unworthy of one
who claims to be a professional communicator - though perhaps that is
not what one should understand "Organization: Allen & Company - Creative
technical writing" to mean.

I actually wrote :-

You should have used news:alt.msdos.batch.nt; this newsgroup was
created for DOS-compatible batch (now DOS..Win98/ME) whereas that
one was created for enhanced batch, and is used by a substantially
greater number of experts in your sort of operating system.

Perhaps you want to deal with that sort of batch in a newsgroup which is
not the one used by the majority of the experts on the topic.

Perhaps you should look back a few months with Google to see how much
better this newsgroup ran between when you went off in a huff and when
you regrettably returned.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Message has been deleted

Todd Vargo

unread,
Apr 18, 2005, 11:58:08 PM4/18/05
to
"Dr John Stockton" <sp...@merlyn.demon.co.uk> wrote in message
news:JZTuquBC...@merlyn.demon.co.uk...

> JRS: In article <4262d906$0$42323$ed26...@ptn-nntp-reader02.plus.net>,
> dated Sun, 17 Apr 2005 22:44:04, seen in news:alt.msdos.batch, William
> Allen <_w...@email.com> posted :
> >
> >"Dr John Stockton" wrote in message
> >...snip
> >> You should have used news:alt.msdos.batch.nt;
> >
> >No. You are wrong. Windows NT/2000/XP operating systems
> >are on-Topic in alt.msdos.batch as parent. Therefore, there is
>
> Quoting half of such a sentence is a childish tactic, unworthy of one
> who claims to be a professional communicator

Interesting. I had similar remarks for Timo on his quoting of my thoughts.
His professional response to me was...

TS> Quote trimming is up the responder, not the "respondee".

Timo Salmi

unread,
Apr 19, 2005, 3:00:15 AM4/19/05
to
Todd Vargo wrote:
> Interesting. I had similar remarks for Timo on his quoting of my thoughts.
> His professional response to me was...

> TS> Quote trimming is up the responder, not the "respondee".

Sarcastic and out of context. But I have parried far enough for the time
being, so I'll try to keep containing myself and concentrate on the more
productive events.

Klaus Meinhard

unread,
Apr 19, 2005, 3:37:02 AM4/19/05
to
Timo,

> 1) You have to decide whether the extra features are worth the
> hassle of changing the command interpreter.
> 2) You have to weigh the advantages against the inconvenience of
> the incompatibilities. Not only of batches rewriting, but some
> programs will cease working properly if you change your command
> interpreter.
> Quoting Richard Bonner from news:alt.msdos.batch "It's an excellent
> replacement. I would switch immediately, but too many of my existing
> batch files didn't run properly."

I fear that these remarks will scare off more people than the rest will
attract :-)

As I have mentioned several times before to Richard, it's easy enough to
set up one's system so that batch files with the BAT file extension will
be executed by command.com, with 4DOS' preferred BTM file extension by
4DOS.com. So you can have your cake and eat it :-)

As mentioned before, setting up 4DOS in it's simplest version means
nothing more than unzipping the files to a directory in the path. This
way you can use it whenever you want by starting it as a child shell
(WinDOS versions) or brother/sister shell (WinNT versions).

Re "some programs will cease workin...": why should they? The only
programs that will experience problems are those that start a shell
_and_ are so dumbly programmed that they call a _hardcoded_ string
"command.com". And even for those there's an alias on my site that will
help :-)

Klaus Meinhard

unread,
Apr 19, 2005, 3:49:00 AM4/19/05
to
Norman,

> You might want to check out the FPMAN220 package mentioned on my
> Computer Tips page,
> http://www.chebucto.ns.ca/~af380/Tips.html#Tip019
> It includes a VGA font editor, a VGA palette editor, and a utility
> for setting new fonts or palettes. You can increase the brightness
> of any of the 16 colours you get.

Similar features plus a few more are found in ANSIPLUS by Kristopher
Sweger, which I happen to use. You get keyboard control on top. Oh yes:
no font editor.

--
Mit freundlichem Gruß,

Klaus Meinhard


Timo Salmi

unread,
Apr 19, 2005, 4:43:57 AM4/19/05
to
Klaus Meinhard wrote:
> Timo,

>>Quoting Richard Bonner from news:alt.msdos.batch "It's an excellent
>>replacement. I would switch immediately, but too many of my existing
>>batch files didn't run properly."

> I fear that these remarks will scare off more people than the rest will
> attract :-)

Hopefully not. That is not what I am after. But they are typical of the
concerns a few users have voiced over time. And detachedly, the comments
are a fair description of the realities of the users' concerns. Right or
wrong.

> As I have mentioned several times before to Richard, it's easy enough to
> set up one's system so that batch files with the BAT file extension will
> be executed by command.com, with 4DOS' preferred BTM file extension by
> 4DOS.com. So you can have your cake and eat it :-)

I'll include in the FAQ a pointer to your posting which I now quote. And
besides, the new batch FAQ items #164 and #165 which we have amply
discussed here recently (thanks), will show an uncommitted method to go
with 4DOS. I think that a user will then make his/her own evaluations.

My own choice, incidentally, was to install a 4DOS box in Windows 95.
But it is clear to me that I'll be retaining COMMAND.COM as my primary
command processor in those two old PCs I still have running Windows 95.
Even if I definitely like what I am seeing in the 4DOS box. There are no
doubts about 4DOS advantages in my mind. Yet, the compatibility with the
major number of other 95 systems still around overrides in my decision.

Of course, I now do most of my work now under XP, but that is a
different story.

> Re "some programs will cease workin...": why should they? The only

One example is programs that use ^ in parameters for purposes other than
4DOS conventions. There have been some other cases discussed, but it was
so many years ago, that I honestly can't recall. Then, some programs are
called via batches, and if the batches happen to be incompatible, then
problems occur. Likewise there are some name collisions like LIST.

There is nothing extraordinary about the situation. It always happens
with any system-affecting updates. It is not limited to 4DOS.

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

William Allen

unread,
Apr 19, 2005, 10:51:05 AM4/19/05
to
"Klaus Meinhard" wrote in message
...snip

> Re "some programs will cease workin...": why should they? The only
> programs that will experience problems are those that start a shell
> _and_ are so dumbly programmed that they call a _hardcoded_ string
> "command.com". And even for those there's an alias on my site that will
> help :-)

You won't better recruit new 4Dos users by calling their existing
coding "dumb". It would be more useful to document relevant
differences users will experience should they try to run MS-DOS
batch files in 4Dos with minimal alterations to their original code.
New users may try - at least at first - to learn/change the minimum
amount (to save time). It takes a while to realise that learning how
to do things properly wastes the least time in the long run

The incremental approach suggested by Timo Salmi - introduce
a few commands in a 4dos.com /c shell - is a good idea for such
new users, and they will steadily gain confidence with 4Dos.

Although 4Dos is surprisingly good at handling native MS-DOS
Batch code, there are many differences that will lead to native
code running differently. Simple example chosen at random:

============Screen capture 4Dos Custom window in Windows 95
c:\work>ver

4DOS 7.50 (Win95) DOS 7.10

c:\work>ECHO Create a file>FILE.TXT

c:\work>del file.txt
Deleting C:\WORK\FILE.TXT
1 file deleted 4,096 bytes freed

c:\work>ECHO Create a file>FILE.TXT

c:\work>command.com /c del file.txt

c:\work>REM Need to use /q switch in 4Dos to achieve same result

c:\work>ECHO Create a file>FILE.TXT

c:\work>del /q file.txt

c:\work>
============End screen capture

The extra information provided by 4Dos is useful, but may
alter the STDOUT result of an existing MS-DOS Batch file,
and were this used in subsequent batch operations, those
operations may fail.

Our current version 4Dos Guide has an extensively commented
EXAMPLE.BAT template showing how, in one Batch file
(for use in a COMMAND.COM shell or MS-DOS window),
you can use both MS-DOS and 4Dos syntax including
the >& STDOUT+STDERR redirector.

The example has two code sections:
(1) Main - code runs in COMMAND.COM shell
(2) _4Dos - code runs in 4dos.com shell

The example shows how to pass data tokens between
the different code sections.

The current version of our 4Dos Guide has a re-written
COMMAND.COM section and uses only 8.3 names
for the ZIP file name and internal file names (all three
points to reflect Timo Salmi's suggestions), and also
has an example directive in our supplied 4dos.ini file to
set default environment to 4096 bytes. The Guide now
mentions the importance of .BTM files and points users
to the 4help item that explains the .BTM extension (this
follows a suggestion by Klaus Meinhard). Our example
4dos.ini file (as before) also has the directives needed
to convert 4Dos command-line editing to the usual
MS-DOS overstrike/insert + block/underline conventions.

Current version of our 4Dos Guide:
Install 4Dos in a Custom window http://www.allenware.com/find?4DosGuide

--
William Allen


Klaus Meinhard

unread,
Apr 19, 2005, 1:14:53 PM4/19/05
to
Timo Salmi wrote:

> One example is programs that use ^ in parameters for purposes other
> than 4DOS conventions. There have been some other cases discussed,
> but it was so many years ago, that I honestly can't recall. Then,
> some programs are called via batches, and if the batches happen to be
> incompatible, then problems occur. Likewise there are some name
> collisions like LIST.

Hmmm, it's been so long for me, too, and I don't recall any better :-)

The ^ character is what in command.com's view? An escape character? I
see that

c:\> echo ^^^^
^^

which would indicate that echo displays an escaped escape char :-). Of
course it is the standard compound character in 4DOS (several commands
on one line), but can be easily changed using SETDOS or OPTION should
need be (bonus to NT users: they can change the compound-, escape- and
parameter chars to use the NT conventions).

Name collisions like LIST (4DOS internal LIST versus external LIST.COM)
are easily remedied by aliasing internal LIST too e. g.

alias see=*list

or something similar. Which leaves the unresolvable very rare case of a
program calling a(n installation-)batch that won't run under error free
under 4DOS - but then there's always the possibility to start a
command.com shell... ;-)

Klaus Meinhard

unread,
Apr 19, 2005, 12:59:17 PM4/19/05
to
William,

> You won't better recruit new 4Dos users by calling their existing
> coding "dumb".

Sorry to contradict: it _is_ dumb, imho, to hardcode the by definition
replaceable shell processor, and it was done, afair, only by a very few
long forgotten free/shareware authors.

> c:\work>REM Need to use /q switch in 4Dos to achieve same result

I have usede 4DOS exclusively for so long that I have long forgotten the
differences. One advantage of 4DOS is that you can alias any command to
change it's standard behaviour to your liking. So an alias

alias del=*del /p

was one of the first ones I added to my list, so I wouldn't delete files
by accident.

alias del=*del /q

would mimick the (dangerous?) command.com behaviour.

> The example has two code sections:
> (1) Main - code runs in COMMAND.COM shell
> (2) _4Dos - code runs in 4dos.com shell

The wisdom of this is lost on me: you have to have 4DOS installed to do
this. Why then this cumbersome method that has only the effect of
slowing things down and keeping users as far apart from 4DOS as
possible? :-(

> http://www.allenware.com/find?4DosGuide

Thanks for providing a fix search adress.

Timo Salmi

unread,
Apr 19, 2005, 1:22:40 PM4/19/05
to
Klaus Meinhard wrote:
> The ^ character is what in command.com's view? An escape character? I

Just a character early on, escape e.g. in XP. You may wish to take a
look at news:comp.os.msdos.4dos where a recent thread (with you
participating) has been resurrected.

Dr John Stockton

unread,
Apr 19, 2005, 4:59:24 PM4/19/05
to
JRS: In article <1113883649.70253ab51c9e267612f958e262218b5c@teranews>,
dated Mon, 18 Apr 2005 23:58:08, seen in news:alt.msdos.batch, Todd
Vargo <todd...@alvantage.com> posted :

And he is right. It is the duty of the quoter to quote fairly, and not
to mislead readers. WA fails in this duty.

The quoter is at liberty to choose which parts of the previous article
he responds to, should quote as much as is appropriate of those parts,
and must do so with integrity.

You have failed to quote my restatement; I actually wrote :-

You should have used news:alt.msdos.batch.nt; this newsgroup was
created for DOS-compatible batch (now DOS..Win98/ME) whereas that
one was created for enhanced batch, and is used by a substantially
greater number of experts in your sort of operating system.

WA does not seem to realise that a.m.b.nt was created for the purpose of
giving NT-class batch a home independent of a.m.b, thereby rendering NT-
class batch off-topic here.

Todd Vargo

unread,
Apr 19, 2005, 8:04:02 PM4/19/05
to

"Timo Salmi" wrote:
> Todd Vargo wrote:
> > Interesting. I had similar remarks for Timo on his quoting of my
thoughts.
> > His professional response to me was...
>
> > TS> Quote trimming is up the responder, not the "respondee".
>
> Sarcastic and out of context.

The context is right on, so if this is viewed as sarcasm, then you must be
admitting your response to me was less than professional. Whatever, just
don't complain about being quoted.


> But I have parried far enough for the time
> being, so I'll try to keep containing myself

But did you not already say... "I'll therefore have to filter you for
awhile, not to be tempted to bite and aggravate the situation further."?


> and concentrate on the more
> productive events.

IF %throw stone%==%run away% ECHO Deja vu another day.
::All the best, Todd

Todd Vargo

unread,
Apr 19, 2005, 9:19:33 PM4/19/05
to

"Dr John Stockton" <sp...@merlyn.demon.co.uk> wrote in message
news:AuIcXQDs...@merlyn.demon.co.uk...

> JRS: In article <1113883649.70253ab51c9e267612f958e262218b5c@teranews>,
> dated Mon, 18 Apr 2005 23:58:08, seen in news:alt.msdos.batch, Todd
> Vargo <todd...@alvantage.com> posted :
> >"Dr John Stockton" <sp...@merlyn.demon.co.uk> wrote in message
> >news:JZTuquBC...@merlyn.demon.co.uk...
> >> JRS: In article
<4262d906$0$42323$ed26...@ptn-nntp-reader02.plus.net>,
> >> dated Sun, 17 Apr 2005 22:44:04, seen in news:alt.msdos.batch, William
> >> Allen <_w...@email.com> posted :
> >> >
> >> >"Dr John Stockton" wrote in message
> >> >...snip
> >> >> You should have used news:alt.msdos.batch.nt;
> >> >
> >> >No. You are wrong. Windows NT/2000/XP operating systems
> >> >are on-Topic in alt.msdos.batch as parent. Therefore, there is
> >>
> >> Quoting half of such a sentence is a childish tactic, unworthy of one
> >> who claims to be a professional communicator
> >
> >Interesting. I had similar remarks for Timo on his quoting of my
thoughts.
> >His professional response to me was...
> >
> >TS> Quote trimming is up the responder, not the "respondee".
>
> And he is right. It is the duty of the quoter to quote fairly, and not
> to mislead readers.

Exactly.

> WA fails in this duty.

Per TS> Quote trimming is up the responder, not the "respondee".

Thus, we have a viscous circle created by his folly. Your effort to prove
your point was wasted as was mine when Timo unfairly trimmed.

Timo Salmi

unread,
Apr 19, 2005, 10:06:10 PM4/19/05
to
Todd Vargo wrote:

> "Timo Salmi" wrote:
>>>His professional response to me was...

>>>TS> Quote trimming is up the responder, not the "respondee".

>>Sarcastic and out of context.

> The context is right on, so if this is viewed as sarcasm, then you must be
> admitting your response to me was less than professional. Whatever, just
> don't complain about being quoted.

You are again trying to troll me for what whatever personal crusade
reason you have decided to take against me lately. When some time ago I
said to Klaus that I did not think that, save for one person (who has
sensibly now stayed away from this) any the regulars are out to get me,
I obviously was very wrong. You are. And in your stubborn persistence of
doing so you are artificially fueling this newsgroup problems.

> But did you not already say... "I'll therefore have to filter you for
> awhile, not to be tempted to bite and aggravate the situation further."?

Yes I did, for "awhile". Not long enough, unfortunately, I now see. Your
continued needling and your repeated attempts to corner me are growing
very tiresome. There is no true substance in your attempts, you are just
trying to find one desperate angle after another to antagonize.

John and William are currently continuing to have a heavy go at each
other over a genuine disagreement. But there at least there is real
substance to the disagreement, whichever view one happens to hold in the
matter.

But you. You have degenerated yourself into nothing but a silly troll
boiling for a fight. Please consider finding someone else to pester with
your strange fishing expeditions.

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

Todd Vargo

unread,
Apr 20, 2005, 12:07:45 AM4/20/05
to

"Timo Salmi" <wrote:

> You are again trying to troll me for what whatever personal crusade
> reason you have decided to take against me lately.

No my dear Timo, I really had been receiving duplicates (and not only from
you). You pretended to know nothing of it ("I beg your pardon, Todd? You
managed to lose me.") but after which the first pair I bothered to examine
happened to be yours showing different ID's, then you admit to posting a
duplicate. I left the discussion open ended that others might chime in to
confirm. Richard Bonner eventually chimed, but not clearly confirming seen
duplicates. Therefore I will ask now. Richard, did you see duplicates?


> There is no true substance in your attempts, you are just
> trying to find one desperate angle after another to antagonize.

No, I suspected that someone (not you) may have been trying to cancel
messages unnoticed, but due to your rude and dismissive actions towards me,
I began proving the fallacy of those actions.

>
> John and William are currently continuing to have a heavy go at each
> other over a genuine disagreement. But there at least there is real
> substance to the disagreement, whichever view one happens to hold in the
> matter.

I applied your fallacy thusly; I quoted you to JRS, who had made a similar
quoting protest to WA (as I to you). But as we can see, he became quite
hostile immediately and began using the word twisting game which you claimed
of me. And now you are playing the same game as he. I pity the both of you.

If you had only bothered to read my post in the helpful light as it was
intended (in an appropriate civil manor), you would not have to hide behind
your filters or pretend I am angling for you. Perhaps you are just too
involved with the group politics to see reason.

>
> But you. You have degenerated yourself into nothing but a silly troll
> boiling for a fight.

No, I am proving my point only, and JRS did just that for me. You dismissed
our original disagreement with an inappropriately applied general rule. When
will you guys ever learn to be polite to others?


> Please consider finding someone else to pester with
> your strange fishing expeditions.

I'm sorry you feel that way, Timo. I truly meant no harm.

All the best,

Timo Salmi

unread,
Apr 20, 2005, 2:31:55 AM4/20/05
to
Klaus Meinhard wrote:

> Timo Salmi wrote:
>>incompatible, then problems occur. Likewise there are some name
>>collisions like LIST.

> Name collisions like LIST (4DOS internal LIST versus external LIST.COM)


> are easily remedied by aliasing internal LIST too e. g.
>
> alias see=*list
>
> or something similar. Which leaves the unresolvable very rare case of a
> program calling a(n installation-)batch that won't run under error free
> under 4DOS - but then there's always the possibility to start a
> command.com shell... ;-)

[I have a comment that goes clearly towards news:comp.os.msdos.4dos so
I'll include it and reset followups as the default. But that is just FYI
of how I set the default newsgroups. Everyone makes his/her own
judicious choices.]

Ok. As far as I can tell running in a 4DOS box, more is required to
remedy the 4DOS LIST vs. LIST.COM clash:

I made an L:\4DOSHOME\4alias.lst file containing
list=F:\TOOLS\LIST.COM
see=*list
That is also the path to LIST.COM is required.

Then I created ALIASES.BTM at path, containing
@echo off
alias /r L:\4DOSHOME\4alias.lst
alias

One then can type ALIASES to make them available. That way this seems to
work.

Klaus Meinhard

unread,
Apr 20, 2005, 2:50:40 AM4/20/05
to
> Per TS> Quote trimming is up the responder, not the "respondee".

This is another example of a completely unnecessary nonsense discussion
a few members of this group is so fond of.

One sentence written without examination of every ramification of every
word, and we have Kilobytes of slashing and flaming to wade through - of
course all under a misleading subject title so it is impossible to avoid
without filtering all the participants wholesale.

One of the consequences of this is that people here tend to quote whole
message threads again and again, further diminishing readabilty of this
group.

Quote trimming _is_ up to the responder (who else?), and of course it
should be done without distorting the original intent. Has anyone really
believed that Timo meant otherwise?

If this isn't Kindergarten, what is it?

Timo Salmi

unread,
Apr 20, 2005, 3:13:00 AM4/20/05
to
Todd Vargo wrote:
> "Timo Salmi" <wrote:
>>You are again trying to troll me for what whatever personal crusade
>>reason you have decided to take against me lately.

> No my dear Timo, I really had been receiving duplicates (and not only from

Not about that one ok note (though it first genuinely baffled me) but
all the other angles you've used.

> I applied your fallacy thusly; I quoted you to JRS, who had made a similar

Now that is exactly the approach I mean. I try not to be goaded deeper
into such artificial mind games. Therefore, I will pass now.

>>Please consider finding someone else to pester with
>>your strange fishing expeditions.

> I'm sorry you feel that way, Timo. I truly meant no harm.

Future events will tell best what to think then.

William Allen

unread,
Apr 20, 2005, 10:45:37 AM4/20/05
to
"Timo Salmi" wrote in message
...snip

> When some time ago I
> said to Klaus that I did not think that, save for one person (who has
> sensibly now stayed away from this) any the regulars are out to get me
...snip

In case the "one person" is a reference to me, I'd like to say
that despite the sometimes less-than-friendly (and often
on reflection too hasty) exchanges Timo and I have had, I
respect Timo's long record of detailed contributions to this
NewsGroup, and I think they place him without doubt on a
par with the "greats" such as John Savage and Tom Lavedas.
I also respect the patience Timo shows with newcomers who
ask questions long ago answered in his excellent FAQ. In turn,
Timo has similarly always shown respect for my own - though
very much briefer - record of Batch contributions.

And in the event I'm not the "one person", that's good, and
I'm still glad to place the above on record, for future reference.

--
William Allen


Timo Salmi

unread,
Apr 20, 2005, 11:43:44 AM4/20/05
to
William Allen wrote:
> "Timo Salmi" wrote in message
>>When some time ago I
>>said to Klaus that I did not think that, save for one person (who has
>>sensibly now stayed away from this) any the regulars are out to get me

> In case the "one person" is a reference to me, I'd like to say

No, do not worry. It is not. And thank you for the balanced words.

> that despite the sometimes less-than-friendly (and often
> on reflection too hasty) exchanges Timo and I have had, I

Now that we have had the time to cool down, and also to give mutually
constructive feedback where it really counts, that is batches, let me
say this. A realist sees when to "agree to disagree", and then go on to
other things. We disagree in one issue. In this newsgroup's scope. We
are both much better off in recognizing and accepting the existence of
that divergence, and then leave it rest at that. Not all things need to
be resolved to coexist in a productive manner. This is much better than
to let the one issue spill over. I share the regret that it did, and I
readily admit to my breach in manners.

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

Todd Vargo

unread,
Apr 21, 2005, 12:18:10 AM4/21/05
to
"Klaus Meinhard" wrote:
> If this isn't Kindergarten, what is it?

alt.msdos.batch of course.

Todd Vargo

unread,
Apr 21, 2005, 12:26:10 AM4/21/05
to

"Timo Salmi" <t...@uwasa.fi> wrote in message
news:42660...@news.dnainternet.net...

> Todd Vargo wrote:
> > "Timo Salmi" <wrote:
> >>You are again trying to troll me for what whatever personal crusade
> >>reason you have decided to take against me lately.

I notice you don't trim your own text improperly to keep an upper hand.


>
> > No my dear Timo, I really had been receiving duplicates (and not only
from
>
> Not about that one ok note (though it first genuinely baffled me) but
> all the other angles you've used.

Time will tell if this needs revisited.

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

James Pryor

unread,
Apr 21, 2005, 12:56:00 PM4/21/05
to
> New users may try - at least at first - to learn/change the minimum
> amount (to save time). It takes a while to realise that learning how
> to do things properly wastes the least time in the long run
...

> The incremental approach suggested by Timo Salmi - introduce
> a few commands in a 4dos.com /c shell - is a good idea for such
> new users, and they will steadily gain confidence with 4Dos.
...

> Although 4Dos is surprisingly good at handling native MS-DOS
> Batch code, there are many differences that will lead to native
> code running differently. Simple example chosen at random:

I think alternative shell processors is a fine idea, but unless there is a need to write scripts capable of executing under all command processors it is simpler to write for, and execute with, the desired or required command processor.

FWIW... I converted a number of batch/CED/PCED/XCED/CMD scripts to 4DOS a number of years ago. Actually, once a task is accomplished, it's not that difficult to convert one way or the other. The originals were all created before Win95, when everyone used the same basic DOS environment.

I no longer get asked any questions about DOS in any form. Nobody is interested in remembering how to format commands for the commandline. Yes, I'm guilty of the same. That is why I spent so much time writing those multipage hotkeyed batch menues back in the 80's.

Now, mostly I write one-off scripts, just get the job done.

I really don't care which type of script I use, or what command processor, or which OS.

Klaus Meinhard

unread,
Apr 22, 2005, 1:43:28 AM4/22/05
to
Todd,

>> If this isn't Kindergarten, what is it?

> alt.msdos.batch of course.

I could have been fooled...

Message has been deleted

Klaus Meinhard

unread,
Apr 24, 2005, 4:15:18 AM4/24/05
to
William Allen wrote:

---lots of text omitted---

1. What is the relation of your contribution to the stated subject of
the thread?

2. You're aiming this clearly at Dr. Stockton. So why not say so?

3. It's an uncalled-for rehash of your often-enough stated position
(which I largely share). So what do you want to achieve?

a. To simply have the last word?

b. To start another round of this slash-fest?

c. To have your fun by watching Dr. Stockton flare up again?

<sigh> Why don't you simply add a few pages to your batch course? The
time would be much better spent, and many people would be grateful.

Message has been deleted
Message has been deleted

Klaus Meinhard

unread,
Apr 26, 2005, 10:06:03 AM4/26/05
to
William Allen wrote:

> The purpose is to make the NewsGroup a more welcoming place
> for newcomers (it's less important to me how much regulars choose
> to abuse each other about redirection or any other matter). Amb has
> a poor reputation for treatment of newcomers. In my view, progress
> has been made recently; some work remains.

I have stated several times already that I share your purpose, but the
danger is to overshoot the target

Once you start rehashing the same arguments without a readily visible
provokation it gets tiresome. I notice that Dr. Stockton seems to keep
quiet (there's a saying here in Germany that the more intelligent ceases
first), but of course I could be mistaken.

Anyway: it's no fun for newcomers to read personal feuds under a
misleading (or any) topic. This doesn't help the amb image in any way.
But that's exactly what they get when they direct a newsreader to
download amb. The X-No-archive: yes doesn't help much because many
people use newsreaders and not Google Groups, and the result is a half
archived, half unarchived and not easily understandable mix of messages.

Message has been deleted
Message has been deleted

Klaus Meinhard

unread,
Apr 27, 2005, 3:14:01 AM4/27/05
to
Todd,

> It is obvious you are having a one-on-one disagreement with WA about
> half archiving a thread. What purpose does archiving your end serve?

I have several reasons I don't like the X-No-Archive: Yes method:

It is frequently used here in amb in messages that are part of flame
wars, off topic postings etc. the authors don't want archived probably
because they are not too proud of them.

The true history of a group, say amb, is falsified: if used
consequently, amb could look like paradise at any one point when
searched from Google Groups, while in reality heavy flame wars rage.

IMHO people should only write things in a newsgroup that can be
archived. Not so long ago you couldn't avoid archiving of messages. ISTM
that the possibility of cancelling messages and the prevention of
archiving furthers irresponsibilty and trolling (or is saving disk space
for Google really a concern here?)

But of course opinions differ. I will just write my postings without
that line.

Timo Salmi

unread,
Apr 27, 2005, 5:25:32 AM4/27/05
to
Klaus Meinhard wrote:
> I have several reasons I don't like the X-No-Archive: Yes method:

For what it is worth, I see this matter in exactly the same light as
you do. The only postings where I prefer the use the X-No-Archive are
the automated, unchanging FAQ postings. Such as I regularly post as
the co-moderator to the news:comp.arhives.msdos.announce newsgroup.
Such postings need not be repeatedly archived at Google etc. Besides
in a slow group they would appear too dominant. Furthermore, such
FAQs are stored elsewhere in FAQ repositories.

Besides, the method is ineffective in a thread.

> IMHO people should only write things in a newsgroup that can be
> archived. Not so long ago you couldn't avoid archiving of
> messages.

Sometimes I may say hasty things. But I have no objections to the
storing and should carry full responsibility about the existence of
what I have might have blurted also in the past.

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

Klaus Meinhard

unread,
Apr 27, 2005, 11:22:17 AM4/27/05
to
Timo Salmi wrote:

> For what it is worth, I see this matter in exactly the same light as
> you do. The only postings where I prefer the use the X-No-Archive are
> the automated, unchanging FAQ postings.

Comprehensible. There may be other good reasons, too.

> Sometimes I may say hasty things.

Others do, too :-)

But if people know enough to add their X-NO-Archive it can't be
hastiness alone, can it? They know that message doesn't belong in that
group.

Message has been deleted
Message has been deleted

foxidrive

unread,
Apr 27, 2005, 8:26:21 PM4/27/05
to
On Wed, 27 Apr 2005 16:52:39 +0100, William Allen wrote:

> I have a disagreement of substance with John Stockton. I don't
> like the supercilious and holier-than-thou tone he takes with
> newcomers.

William, take it to email or use filters, please.

It is loading more messages.
0 new messages