Discussion:
autoexec.bat when finished the prompt appears at the end of the line, rather than below
(too old to reply)
NDog
2009-04-12 03:42:54 UTC
Permalink
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
r***@highfiber.com
2009-04-13 02:00:03 UTC
Permalink
Post by NDog
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 ***@highfiber.com
NDog
2009-04-13 22:36:29 UTC
Permalink
Post by r***@highfiber.com
Post by NDog
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.)
--
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.

Loading...