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

How to get the path of a batch file

222 views
Skip to first unread message

Walter Briscoe

unread,
Jun 2, 2005, 12:35:58 PM6/2/05
to
I have a batch file intended to work with either cmd.exe or COMMAND.COM.
It works with cmd.exe (in NT) but not with COMMAND.COM (in W9X).

A line of the following form is the problem:
set MYDIR=%~dp0
If the batch file is A:\B\C.BAT, that line is equivalent to
set MYDIR=A:\B

I want equivalent functionality in COMMAND.COM.
TRUENAME %0 returns A:\B\C or A:\B\C.BAT.
A:\B\C\.. or A:\B\C.BAT\.. would suit my purpose without being pretty.

In Timo Salmi's useful archive in ftp://garbo.uwasa.fi/pc/ts/tsbatxx.zip
there is a topic:
121) How to make %0 include the full path of the called batch file?

His second alternative uses gawk - an awk clone - to transform the
truename output to an appropriate batch file. (I would use sed if I had
the luxury of a 3rd party tool.)

To anyone with appropriate knowledge a debug solution is probably easy.
Sadly, I lack that knowledge. I did not find edlin installed by default
in a W98SE system and so that useful tool is ruled out.

Can someone kindly propose a solution? Please!
--
Walter Briscoe

foxidrive

unread,
Jun 2, 2005, 3:32:32 PM6/2/05
to
On Thu, 2 Jun 2005 16:35:58 +0000, Walter Briscoe wrote:

> I have a batch file intended to work with either cmd.exe or COMMAND.COM.
> It works with cmd.exe (in NT) but not with COMMAND.COM (in W9X).
>
> A line of the following form is the problem:
> set MYDIR=%~dp0
> If the batch file is A:\B\C.BAT, that line is equivalent to
> set MYDIR=A:\B
>
> I want equivalent functionality in COMMAND.COM.
> TRUENAME %0 returns A:\B\C or A:\B\C.BAT.
> A:\B\C\.. or A:\B\C.BAT\.. would suit my purpose without being pretty.

Is it going to be the current folder, or can it be anyplace on the path?
Will the filename be unique?

William Allen

unread,
Jun 2, 2005, 5:43:46 PM6/2/05
to
"Walter Briscoe" wrote in message

> I have a batch file intended to work with either cmd.exe or COMMAND.COM.
> It works with cmd.exe (in NT) but not with COMMAND.COM (in W9X).
>
> A line of the following form is the problem:
> set MYDIR=%~dp0
> If the batch file is A:\B\C.BAT, that line is equivalent to
> set MYDIR=A:\B
>
> I want equivalent functionality in COMMAND.COM.
> TRUENAME %0 returns A:\B\C or A:\B\C.BAT.
> A:\B\C\.. or A:\B\C.BAT\.. would suit my purpose without being pretty.

TRUENAME has problems with long-named folders, and
is not a reliable way to find the path to the current Batch file.

For the Windows 95/98/ME GUI, I devised the following simple
START method. This grabs the short-name alias of the full
path to the current Batch file. It depends on the fact that START
in Windows 95/98/ME looks up the full path to the Batch file
and loads it into %0 when a Batch file is called with START.

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
@ECHO OFF
IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}

start /wait /min %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
ECHO. Path to Self=%SELF%
SET SELF=

GOTO EOF {=Subroutine-section-below=}
:_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
ECHO.SET %3=%0>%4

: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.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

However, if you want to grab the STDOUT output of TRUENAME
into a variable (or the STDOUT output of almost any other command),
you can use the Universal Prefix method, as follows:

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

:: Make Universal Prefix file
ECHO.e0'SET FN='>%TEMP%.\_P.BAT
FOR %%C IN (rcx 7 w0 q) DO ECHO.%%C>>%TEMP%.\_P.BAT
TYPE %TEMP%.\_P.BAT | debug %TEMP%.\_P.BAT>NUL

TRUENAME %0 | find /i "%0">>%TEMP%.\_P.BAT

:: Grab the text in variable and delete workfile
FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_P.BAT

ECHO. Contents of FN=%FN%

====End cut-and-paste (omit this line)
For Win95/98/ME study/demo use. Cut-and-paste as plain-text Batch file.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

Obviously, you can append the own-folder-generating suffix .\.. to %FN%
to use it as an own-folder specification that will usually be accepted by
most commands.

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


Walter Briscoe

unread,
Jun 3, 2005, 1:28:47 AM6/3/05
to
In message <1eozt5mndbs7z.1wdflm10py0nm$.d...@40tude.net> of Fri, 3 Jun
2005 05:32:32 in alt.msdos.batch, foxidrive
<mi...@melbpc.org.au.gotcha.invalid> writes
%0 can be anywhere. ., on %PATH%, or not on %PATH%
I want a caller to be able to say foo, foo.bat, .\foo, a:\b\foo, etc.

>Will the filename be unique?

It will. An ideal solution will not rely on that.
If I change the name of foo.bat to bar.bat, I don't want to have to
change an embedded "foo" to an embedded "bar".

I think I can see where you are going on that.
With a given value of %0, one could try several alternatives in turn.
That is likely to result in an exhausting exhaustive solution.

Although its absence from W98SE makes EDLIN an unsuitable tool,
I decided to look at its use in W2K with an ancient MSDOS 5.0 paper
manual as my guide. I was trying to find instructions to map A:\B\FOO or
C:\E\F\G\BAR.BAT to set MYDIR=A:\B and set MYDIR=C:\E\F\G respectively.
I failed miserably. EDLIN has controls such as F1, DEL and INS which
seem impossible to script. OTOH, it does allow a file to be specified on
the command line and take commands from standard input.

A trivial script works:
> %temp%.\2name.bat echo A:\B\FOO
echo E | EDLIN %temp%.\2name.bat

The following works but does not seem amenable to scripting:
EDLIN %temp%.\2name.bat
1<CR>
<INS>set MYDIR=<F3><CR>
E<CR>

I never learnt to use EDLIN. MSDOS 5.0 was the earliest MS OS I used and
had introduced the sophistication of EDIT.
BTW. W2K help documents interline commands such as E but not the
intraline key functions such as <F3>, etc. I have not tried decompiling
the help chm to look for them.

In his FAQ, Timo Salmi refers EDLIN as cumbersome and notorious.
He shows a few examples suitable to scripting but none use intraline key
functions and restrict themselves to interline commands.
He also mentions QBASIC. I shall investigate its suitability.
--
Walter Briscoe

Walter Briscoe

unread,
Jun 3, 2005, 5:59:05 AM6/3/05
to
In message <429f7dbc$0$1712$ed2e...@ptn-nntp-reader04.plus.net> of Thu,
2 Jun 2005 22:43:46 in alt.msdos.batch, William Allen <_w...@email.com>
writes
Thanks William for a VERY much better solution than I imagined.

>"Walter Briscoe" wrote in message

[snipped a request looking for a Win9X equivalence of the W2K %~dp0]

>TRUENAME has problems with long-named folders, and
>is not a reliable way to find the path to the current Batch file.

The problem is that MS never documented TRUENAME and saw no need to keep
it working when Win95 was introduced.
In C:\My Document Files, I found TRUENAME . returned C:\MYDOCUME
I guess it truncates its argument to an 8.3 name.

>
>For the Windows 95/98/ME GUI, I devised the following simple
>START method. This grabs the short-name alias of the full
>path to the current Batch file. It depends on the fact that START
>in Windows 95/98/ME looks up the full path to the Batch file
>and loads it into %0 when a Batch file is called with START.
>
>Lines that don't begin with two spaces have wrapped accidentally
>====Begin cut-and-paste (omit this line)
> @ECHO OFF

I found that commenting that line caused the start below not to stop.
It is probably something in the command.pif on the machine I was testing
on. When I do exit, it leaves a window in place which has to be manually
closed.

> IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}
>
> start /wait /min %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
> FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
> ECHO. Path to Self=%SELF%
> SET SELF=
>
> GOTO EOF {=Subroutine-section-below=}
> :_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
> ECHO.SET %3=%0>%4
>
> :EOF {End-of-file}
>
>====End cut-and-paste (omit this line)

[snipped example using "universal prefix method". Given TRUENAME's
limitations, it does not suit.]

Thanks William. I have melded the concepts you show to the offending
script and will forward the result to the author. I will credit you.
--
Walter Briscoe

William Allen

unread,
Jun 3, 2005, 10:54:46 AM6/3/05
to
"Walter Briscoe" wrote in message
...snip

> >Lines that don't begin with two spaces have wrapped accidentally
> >====Begin cut-and-paste (omit this line)
> > @ECHO OFF
> I found that commenting that line caused the start below not to stop.
> It is probably something in the command.pif on the machine I was testing
> on. When I do exit, it leaves a window in place which has to be manually
> closed.
...snip

If you need to run the main section with command ECHOing ON, you will
need to add @ECHO OFF + CLS to the _GETSELF Subroutine code to have
the child process window close automatically and thus return control to
the main code section. The principle of automatic DVM window closure is
that there should be no messages or command ECHOes on screen as the
Batch file finishes its operation.

For more details about this, see relevant section of our "Usual Suspects"
troubleshooter: http://www.allenware.com/mcsw/bus.htm#WindowClose

The modified example below shows typical debugging syntax to avoid any
need to close the STARTed child process window manually:

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

:: Normal @ECHO OFF command commented out for debugging code


IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}

start /wait /min %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
ECHO. Path to Self=%SELF%
SET SELF=

GOTO EOF {=Subroutine-section-below=}
:_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
ECHO.SET %3=%0>%4

:: Turn off ECHOing and execute CLS to close child process
@ECHO OFF
CLS

: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.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

--

Timo Salmi

unread,
Jun 3, 2005, 2:09:03 PM6/3/05
to
Walter Briscoe <wbri...@nospam.demon.co.uk> wrote:
> In his FAQ, Timo Salmi refers EDLIN as cumbersome and notorious.

> He also mentions QBASIC. I shall investigate its suitability.

For its age QBASIC is surprisingly versatile and powerful, in many
resepcts even up to par Visual Basic of the later Windows versions.

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

Walter Briscoe

unread,
Jun 4, 2005, 2:41:03 AM6/4/05
to
In message <42a06f45$0$7582$ed26...@ptn-nntp-reader03.plus.net> of Fri,
3 Jun 2005 15:54:46 in alt.msdos.batch, William Allen <_w...@email.com>
writes
[snip]

>The modified example below shows typical debugging syntax to avoid any
>need to close the STARTed child process window manually:
>
>Lines that don't begin with two spaces have wrapped accidentally
>====Begin cut-and-paste (omit this line)
> :: @ECHO OFF
> :: Normal @ECHO OFF command commented out for debugging code
> IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}
>
> start /wait /min %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
> FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
> ECHO. Path to Self=%SELF%
> SET SELF=
>
> GOTO EOF {=Subroutine-section-below=}
> :_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
> ECHO.SET %3=%0>%4
> :: Turn off ECHOing and execute CLS to close child process
> @ECHO OFF
> CLS
>
> :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.
>Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

I extracted your words into foo.bat and found it did not close.
After looking at UsualSuspects, I threw in an exit after the CLS. I
still got a blank "Finished: foo.bat" window I had to manually close.

I don't think that problem is worth more effort.
I DID find I could get half a loaf with the following:

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

@ECHO %DEBUG% OFF


IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}

:: The recursive call's window stays open if anything is written to it
SET WASDEBUG=%DEBUG%
SET DEBUG=
start /min /wait %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
SET DEBUG=%WASDEBUG%
SET WASDEBUG=


FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
ECHO. Path to Self=%SELF%
SET SELF=

GOTO EOF {=Subroutine-section-below=}
:_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
ECHO.SET %3=%0>%4
:: Turn off ECHOing and execute CLS to close child process
@ECHO OFF
CLS

exit

: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.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

Timo, I am sure QBASIC merits study. I will bear it in mind in future.
Meanwhile, William has given an adequate solution.
--
Walter Briscoe

William Allen

unread,
Jun 4, 2005, 12:27:33 PM6/4/05
to
"Walter Briscoe" wrote in message
...snip
> I extracted your words into foo.bat and found it did not close.
> After looking at UsualSuspects, I threw in an exit after the CLS. I
> still got a blank "Finished: foo.bat" window I had to manually close.
...snip

"Finished: foo.bat" was probably the main window, not the child
process. My intention was to leave that main window open in the
debug version, so that messages and command ECHOes could be read.

I think we were talking at cross purposes. In my posted debug version
the intention was only to close the STARTed subprocess automatically.
The subprocess has a separate minimized window, and briefly appears
as a Taskbar button. If it doesn't close automatically, the main process
will hang at the START/wait line.

If you want to run from a shortcut, and have the main window close
automatically (but without using @ECHO OFF initially so you can
see commands ECHOed), you need a further @ECHO OFF + CLS
at the end of the main process, as below. However, this means
you won't easily be able to read any error messages or command
ECHOes in the main window, so I've added an [optional] CHOICE
with 5-second timeout to yes to close the main window. Answering
N should leave the main window open; answering Y or not answering
within 5 seconds will close the window. If you really want the main
window to close immediately it's finished, take out the CHOICE
and IF ERRORLEVEL lines.

Again, this version of the code is for debugging only:

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
:: @ECHO OFF
:: Normal @ECHO OFF command commented out for debugging code
IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}

start /wait /min %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
ECHO. Path to Self=%SELF%
SET SELF=

:: Optional CHOICE to retain any error messages on screen
:: Timeout=Yes to close window automatically after 5 seconds
choice /c:yn /n /ty,5 " Close window now y/n "
IF ERRORLEVEL 2 GOTO EOF

:: Turn off ECHOing and execute CLS to close main process
@ECHO OFF
CLS

GOTO EOF {=Subroutine-section-below=}
:_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
ECHO.SET %3=%0>%4
:: Turn off ECHOing and execute CLS to close child process
@ECHO OFF
CLS

: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.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

With Subroutine-based code, especially with STARTed Subroutines, there
are multiple "threads" going on in one Batch file, and each one behaves
more-or-less independently. Effectively, in the above demo, there are two
quite separate Batch processes coded in the one file.

William Allen

unread,
Jun 4, 2005, 1:46:30 PM6/4/05
to
"William Allen" wrote in message
...snip

> With Subroutine-based code, especially with STARTed Subroutines, there
> are multiple "threads" going on in one Batch file, and each one behaves
> more-or-less independently. Effectively, in the above demo, there are two
> quite separate Batch processes coded in the one file.

And for anyone hazy on the logic of the code flow through Windows
95/98/ME Batch Subroutines...

For details of how to use and write Batch Subroutines, you can read our
Subroutine StudyPack at: http://www.allenware.com/find?BatchSubroutines
This StudyPack includes an interactive Tutorial, in colour, which walks
you through the logic flow of a Subroutine to show how it works and how
parameters are passed to it. There is also a template that you can use.

(For Windows 95/98/ME only. Uses non-ANSI-dependent colour).

Walter Briscoe

unread,
Jun 5, 2005, 8:02:29 AM6/5/05
to
In message <42a1d681$0$7456$ed26...@ptn-nntp-reader03.plus.net> of Sat,
4 Jun 2005 17:27:33 in alt.msdos.batch, William Allen <_w...@email.com>
writes

>"Walter Briscoe" wrote in message
>...snip
>> I extracted your words into foo.bat and found it did not close.
>> After looking at UsualSuspects, I threw in an exit after the CLS. I
>> still got a blank "Finished: foo.bat" window I had to manually close.
>...snip
>
>"Finished: foo.bat" was probably the main window, not the child
>process. My intention was to leave that main window open in the
>debug version, so that messages and command ECHOes could be read.
>
>I think we were talking at cross purposes. In my posted debug version
>the intention was only to close the STARTed subprocess automatically.
>The subprocess has a separate minimized window, and briefly appears
>as a Taskbar button. If it doesn't close automatically, the main process
>will hang at the START/wait line.

I think I understood your previous posting.
I apologise that I failed to convey my meaning.
I repeat my description with more detail to try to avoid ambiguity.

I am currently running foo.bat on a W98SE system.

The main process is running in a window which has a title:
START /wait /min foo GOTO: _GETSELF SELF C:\WINDOWS\TEMP.\GETSELF.B...
(There is no room for the complete title)

The last line in that window is:
C:\wfb\william> start /wait /min foo GOTO: ... _GETSELF.BAT
(I put the ... in my transcription of the real line)

The subprocess window appears minimized on the Taskbar.
When I open it, it has the title: "Finished - foo.bat"
and there is no text in the "body" of the window which has a blue
background. (I forget how I have things set to cause yellow text to
appear on a blue background.)
When I manually close the subprocess window, the main process unblocks
and echoes %SELF% as expected.

>
>If you want to run from a shortcut, and have the main window close
>automatically (but without using @ECHO OFF initially so you can
>see commands ECHOed), you need a further @ECHO OFF + CLS
>at the end of the main process, as below. However, this means
>you won't easily be able to read any error messages or command

I don't want that, thanks!
In principle I could remove /min from the start command and use your
choice technique to see what was happening in the child window.

I expect you are as surprised as I that the blank child window does not
close automatically.

[snip]

>With Subroutine-based code, especially with STARTed Subroutines, there
>are multiple "threads" going on in one Batch file, and each one behaves
>more-or-less independently. Effectively, in the above demo, there are two
>quite separate Batch processes coded in the one file.

I understand. The problem is that the child does not automatically close
if it ever writes to its window. @ECHO OFF + CLS is ineffective.
I also found @ECHO OFF + CLS + EXIT ineffective.
I suspect there are peculiarities in the W98SE system I am using.
I found echo on in the parent and echo off in the child adequate.

Later: I have a diagnosis. I was using PROMPT to put yellow on blue.
When I commented that statement in a file called from AUTOEXEC.BAT,
the script behaved as intended. i.e. the child inished automatically.

I don't have a workaround to put in foo.bat which is proof against users
who use PROMPT in such a fashion. I found PROMPT $p$g ineffective.
--
Walter Briscoe

William Allen

unread,
Jun 5, 2005, 8:50:42 AM6/5/05
to
"Walter Briscoe" wrote in message
...snip
> Later: I have a diagnosis. I was using PROMPT to put yellow on blue.
> When I commented that statement in a file called from AUTOEXEC.BAT,
> the script behaved as intended. i.e. the child inished automatically.
>
> I don't have a workaround to put in foo.bat which is proof against users
> who use PROMPT in such a fashion. I found PROMPT $p$g ineffective.
...snip

Any colour in child process window must be cleared to standard
GreyOnBlack to allow automatic window closure in the child process.
In this case, you can clear the colour in the child process as follows:

(a) Set new Colour-clearing PROMPT
(b) Make sure ECHO is ON so that Colour-clearing PROMPT is executed
(c) Insert a blank line in Batch file to execute the new PROMPT
(d) Then use CLS with ECHO OFF to clear to GreyOnBlack
(Probably, the ECHO OFF won't be needed, but I include it anyway).

Again, all this applies only when command ECHOing is on in main
section.

Lines that don't begin with two spaces have wrapped accidentally
====Begin cut-and-paste (omit this line)
:: @ECHO OFF
:: Normal @ECHO OFF command commented out for debugging code
IF [GOTO:]==[%1] GOTO %2 {Subroutine-Handler}

start /wait /min %0 GOTO: _GETSELF SELF %TEMP%.\_GETSELF.BAT
FOR %%C IN (CALL DEL) DO %%C %TEMP%.\_GETSELF.BAT
ECHO. Path to Self=%SELF%
SET SELF=

GOTO EOF {=Subroutine-section-below=}


:_GETSELF (Usage: CALL %0 GOTO: _GETSELF VarName WorkFileName)
ECHO.SET %3=%0>%4

:: Ensure ECHO is ON (so that new prompt is ECHOed)
ECHO ON
:: Set Colour-clearing PROMPT, insert blank line (so new PROMPT used)
prompt $e[m

@ECHO OFF
CLS

: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.
Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

--

Walter Briscoe

unread,
Jun 5, 2005, 12:52:53 PM6/5/05
to
In message <42a2f53b$0$1710$ed2e...@ptn-nntp-reader04.plus.net> of Sun,
5 Jun 2005 13:50:42 in alt.msdos.batch, William Allen <_w...@email.com>
writes

>"Walter Briscoe" wrote in message
>...snip
>> Later: I have a diagnosis. I was using PROMPT to put yellow on blue.
>> When I commented that statement in a file called from AUTOEXEC.BAT,
>> the script behaved as intended. i.e. the child inished automatically.
>>
>> I don't have a workaround to put in foo.bat which is proof against users
>> who use PROMPT in such a fashion. I found PROMPT $p$g ineffective.
>...snip
>
>Any colour in child process window must be cleared to standard
>GreyOnBlack to allow automatic window closure in the child process.
>In this case, you can clear the colour in the child process as follows:

Thanks! William. That works a treat.

>Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects

You may want to update ...UsualSuspects in the light of this thread.
--
Walter Briscoe

William Allen

unread,
Jun 5, 2005, 3:47:14 PM6/5/05
to
"Walter Briscoe" wrote in message
> Thanks! William. That works a treat.
>
> >Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects
>
> You may want to update ...UsualSuspects in the light of this thread.

Yes, we were thinking that when you confirmed operation,
we'd think about adding an example to that section.

Walter Briscoe

unread,
Jun 6, 2005, 3:53:32 AM6/6/05
to
In message <42a35950$0$1692$ed2e...@ptn-nntp-reader04.plus.net> of Sun,
5 Jun 2005 20:47:14 in alt.msdos.batch, William Allen <_w...@email.com>
writes

>"Walter Briscoe" wrote in message
>> Thanks! William. That works a treat.
>>
>> >Batch file troubleshooting: http://www.allenware.com/find?UsualSuspects
>>
>> You may want to update ...UsualSuspects in the light of this thread.
>
>Yes, we were thinking that when you confirmed operation,
>we'd think about adding an example to that section.

Good stuff!

By the way! When I view http://www.allenware.com/find online in IE, it
appears as intended. When I save it and then view the saved file, it is
garbled. ISTR mentioning this a long time ago and your having no
interest in fixing it. I don't feel like making the effort to analyse
the problem given my primitive HTML abilities.
--
Walter Briscoe

Dr John Stockton

unread,
Jun 6, 2005, 3:42:07 PM6/6/05
to
JRS: In article <4YXsKMC8...@guybriscoe.freeserve.co.uk>, dated
Mon, 6 Jun 2005 07:53:32, seen in news:alt.msdos.batch, Walter Briscoe
<wbri...@nospam.demon.co.uk> posted :

>By the way! When I view http://www.allenware.com/find online in IE, it
>appears as intended. When I save it and then view the saved file, it is
>garbled. ISTR mentioning this a long time ago and your having no
>interest in fixing it. I don't feel like making the effort to analyse
>the problem given my primitive HTML abilities.


Heavy dependence on CSS (or on javascript or vbscript in include files)
could have that effect; if they are used, you should be able to spot an
obvious reference or references in View Source, probably near the top.

You may be able to spot the cached version of any CSS files in your own
computer (and the cached version of the page); if you copy those to an
appropriate position relative to the saved page file, you may well see
the original style again.

Almost all pages on my site now use CSS; but they do not over-depend on
the CSS file, and are usable if saved without it.

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

Message has been deleted
Message has been deleted

Walter Briscoe

unread,
Jun 8, 2005, 3:48:29 AM6/8/05
to
In message <42a6853c$0$41902$ed26...@ptn-nntp-reader03.plus.net> of
Wed, 8 Jun 2005 06:40:51 in alt.msdos.batch, William Allen
<_w...@email.com> writes
>X-No-archive: yes

>
>"Walter Briscoe" wrote in message
>...snip

>> By the way! When I view http://www.allenware.com/find online in IE, it
>> appears as intended. When I save it and then view the saved file, it is
>> garbled. ISTR mentioning this a long time ago and your having no
>> interest in fixing it.
>
>There is no "it" to "fix". ...

[snip]

We differ on that; I should not examine donated equine dentistry.

>As I've said before, we neither provide (nor support the use of) our
>free Web pages outside a Browser cache. I've no doubt that many people
>violate the copyright of Websites by copying them outside a Browser
>cache without author permission ...
[snip]

On what legal authority do you base your copyright view?

Having no legal training, I have no view on the correctness of your
view. I would like to be informed. I have prompted the expression of a
strongly-held view and would like to understand it.
--
Walter Briscoe

Message has been deleted

Walter Briscoe

unread,
Jun 8, 2005, 8:51:35 AM6/8/05
to
In message <42a6b0e3$0$41923$ed26...@ptn-nntp-reader03.plus.net> of
Wed, 8 Jun 2005 09:48:02 in alt.msdos.batch, William Allen
<_w...@email.com> writes
>X-No-archive: yes
>
>"Walter Briscoe" wrote in message

[snip]

>> On what legal authority do you base your copyright view?
>>
>> Having no legal training, I have no view on the correctness of your
>> view. I would like to be informed.

>...snip
>
>Then read any standard, up-to-date textbook on Intellectual Property Law, eg:
>Intellectual Property Law 2nd Ed, Bently & Sherman, Pub: Oxford 2004.
>
>Page 222=====Quote begins:
>17. TEMPORARY TECHNOLOGY DICTATED COPIES
>In order to implement Article 5(1) of the Information Society
>Directive, a new defense was introduced in October 2003 relating
>to the temporary copying of copyright works other than programs
>or databases. This applies only if four conditions are met:
>(i) the copy must be transient or incidental
>(ii) the making of the copy must be 'an integral and essential
>part of a technological process'
>... [edit out two other conditions about "only to allow transmission"
>and "copy must have no independent economic significance"] ...
>The provision appears to have been designed to allow 'caching',
>that is the temporary storage of information in the user's computer
>or server which allows for speedier access to websites.
>======Quote ends
> Quoted under the usual dispensation for short extracts.

[I think that is part of "fair use".]

Thank you very much. I am now better-informed.
I am not sure, as a result of reading what you quote, that off-line
working is permitted. I agree that "Save As..." seems to fail given (ii)
above but suspect that off-line working also so fails. I don't want to
pursue this much further. I have taken the thread off topic.
--
Walter Briscoe

Message has been deleted
0 new messages