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

autoexec.bat when finished the prompt appears at the end of the line, rather than below

4 views
Skip to first unread message

NDog

unread,
Apr 11, 2009, 11:42:54 PM4/11/09
to
I was wondering why I kept getting strange behavior when I exited
scripts, and I found it has to do with, whether autoexec.bat launches
your script, or whether you manually launch it. For example

autoexec.bat
......
c:\4dos\kstack.com
call c:\test.btm


test.btm
@echo off
setlocal
cls

echo This is a test
echos If you reference this in autoexec.bat the prompt appears here

endlocal
quit


When you reboot into dos (im using dos 7.10), the above will cause the
output to look like
This is a test
If you reference this in autoexec.bat the prompt appears hereC:\>

however if you run test.btm from the command line, it will look like
this
This is a test
If you reference this in autoexec.bat the prompt appears here
C:\>

You can see the autoexec.bat launched script, exits with the prompt
appearing and the same line, and the manually launched script exits
with the prompt beneath the line. I know this is a minor issue, but is
there someway I could make this behavior stop, or at least always get
consistent results, or is this just a case of DOS 7.10 being a bad
version?

Thanks

ras...@highfiber.com

unread,
Apr 12, 2009, 10:00:03 PM4/12/09
to
On Apr 11, 9:42 pm, NDog <nrs...@gmail.com> wrote:
> I was wondering why I kept getting strange behavior when I exited
> scripts, and I found it has to do with, whether autoexec.bat launches
> your script, or whether you manually launch it. For example
>
> autoexec.bat
> ......
> c:\4dos\kstack.com
> call c:\test.btm
>
> test.btm
> @echo off
> setlocal
> cls
>
> echo This is a test
> echos If you reference this in autoexec.bat the prompt appears here
>
> endlocal
> quit

I would suggest simply putting an ECHO. after the CALL in
AUTOEXEC.BAT.

(I *think* what's going on is that 4DOS automatically issues a CRLF
when returning to the prompt from a batch file, but doesn't do it
after AUTOEXEC.BAT. Or possibly it *used* to issue a CRLF after
AUTOEXEC.BAT, but Lucho removed that behavior for some reason; I have
a vague recollection of him making some such cosmetic change. Or I
could be completely mistaken about all of this.... At any rate, if
you want a CRLF, it's easy enough to generate one.)

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

NDog

unread,
Apr 13, 2009, 6:36:29 PM4/13/09
to

Thank you, this is quite a simple solution that I didn't think of, but
it solved the problem.

Just remember to 'call' the script else, the echo. won't apply since
the autoexec.bat is finished if you didn't 'call' it.

0 new messages