Discussion:
autoexec.bat
(too old to reply)
Tom Del Rosso
2021-03-07 01:21:34 UTC
Permalink
I don't think I understand this. It appears to say that autoexec.bat
can't call another batch (if called it won't be parsed) but how is that
"useful?"

https://ss64.com/nt/set.html

"If autoexec.bat CALLS any secondary batch files, the additional batch
files will NOT be parsed at boot.
This behaviour can be useful on a dual boot PC."
--
Defund the Thought Police
JJ
2021-03-07 12:31:12 UTC
Permalink
Post by Tom Del Rosso
I don't think I understand this. It appears to say that autoexec.bat
can't call another batch (if called it won't be parsed) but how is that
"useful?"
https://ss64.com/nt/set.html
"If autoexec.bat CALLS any secondary batch files, the additional batch
files will NOT be parsed at boot.
This behaviour can be useful on a dual boot PC."
That refers to MS-DOS environment only.
In Windows NT, AUTOEXEC.BAT is no longer part of an OS boot.
Tom Del Rosso
2021-03-07 14:35:57 UTC
Permalink
Post by JJ
Post by Tom Del Rosso
I don't think I understand this. It appears to say that autoexec.bat
can't call another batch (if called it won't be parsed) but how is
that "useful?"
https://ss64.com/nt/set.html
"If autoexec.bat CALLS any secondary batch files, the additional
batch files will NOT be parsed at boot.
This behaviour can be useful on a dual boot PC."
That refers to MS-DOS environment only.
In Windows NT, AUTOEXEC.BAT is no longer part of an OS boot.
That's even less consistent with their use of the word "useful."

I haven't used it since DOS, but "the additional batch files will NOT be
parsed" implies that AUTOEXEC _is_ parsed in whatever version they meant
(and this is in the cmd section which should mean NT). If they were
refering to DOS then the called batch files would also run, so what
version would run AUTOEXEC but not secondary files called by it?
--
Defund the Thought Police
Tom Del Rosso
2021-03-07 14:42:42 UTC
Permalink
Post by Tom Del Rosso
(and this is in the cmd section which should mean NT)
And the URL says nt.
--
Defund the Thought Police
JJ
2021-03-08 02:12:38 UTC
Permalink
Post by Tom Del Rosso
That's even less consistent with their use of the word "useful."
I haven't used it since DOS, but "the additional batch files will NOT be
parsed" implies that AUTOEXEC _is_ parsed in whatever version they meant
(and this is in the cmd section which should mean NT). If they were
refering to DOS then the called batch files would also run, so what
version would run AUTOEXEC but not secondary files called by it?
I'm not entirely sure myself regarding what they meant by "parsed" in that
context. Cause, a batch file's code _must_ be parsed in order to be
executed.

All MS-DOS v7 (Win98), v6.22, and v5.00 have no problem executing another
batch file using CALL command during the OS startup.
Robert Roland
2021-03-08 21:56:11 UTC
Permalink
Post by JJ
I'm not entirely sure myself regarding what they meant by "parsed" in that
context.
Windows NT will not execute autoexec.bat, but will parse it for SET
commands. If it finds any, those variables will be set.

The parsing is a simple search, so any CALLs to other files will not
be followed.
--
RoRo
Tom Del Rosso
2021-03-08 22:28:17 UTC
Permalink
Post by Robert Roland
Windows NT will not execute autoexec.bat, but will parse it for SET
commands. If it finds any, those variables will be set.
The parsing is a simple search, so any CALLs to other files will not
be followed.
Aha. I knew this once but forgot all about it.

Thanks.


--
JJ
2021-03-09 05:39:19 UTC
Permalink
Post by Robert Roland
Windows NT will not execute autoexec.bat, but will parse it for SET
commands. If it finds any, those variables will be set.
The parsing is a simple search, so any CALLs to other files will not
be followed.
That article definitely treats MS-DOS COMMAND.COM as Windows NT's CMD. It
shouldn't.

Windows NT's CMD.EXE, and 32-bit Windows NT's COMMAND.COM including the
NTVDM do not use AUTOEXEC.BAT. None of their code have any reference to
"AUTOEXEC.BAT". In 32-bit Windows NT, the only thing related to "AUTOEXEC",
is the AUTOEXEC.NT in C:\WINDOWS\SYSTEM32.

In CMD, AUTOEXEC.BAT regardless of its location, is just a normal batch
file. It's not a special batch file and doesn't have a special treatment.
Robert Roland
2021-03-09 21:47:08 UTC
Permalink
Post by JJ
That article definitely treats MS-DOS COMMAND.COM as Windows NT's CMD. It
shouldn't.
I am not talking about the command processors. I am talking about
Windows. It parses the autoexec.bat at boot and adds the variables to
the environment of all processes. It does not, however, show the
variables in the GUI for setting env. variables.

If I remember correctly, there was a registry setting you could add to
turn off this feature.

It seems they have abandoned this parsing behavior somewhere along the
line. I just tested on Windows 10, which does not do it. I also tested
on Windows 2000, which does do it.
--
RoRo
JJ
2021-03-10 04:17:28 UTC
Permalink
Post by Robert Roland
It seems they have abandoned this parsing behavior somewhere along the
line. I just tested on Windows 10, which does not do it. I also tested
on Windows 2000, which does do it.
Which Service Pack version is that? Or is it a Gold / non Service Pack
version? Cause I have different results.

I have fresh installations of all Windows versions in VMs because I research
them a lot.

However for Windows 2000, I only have the SP4 version. In that version, it
does not process the AUTOEXEC.BAT. Same goes to Windows NT 4.0 SP6.

But in Windows NT 3.51 SP5, it does processes the AUTOEXEC.BAT.

So, somewhere in the Service Pack version of both Windows NT4 and Windows
2000, the AUTOEXEC.BAT processing is removed.

Regardless, the absence of this information makes the article suggest that
it applies to all Windows NT versions. Likely because it's no longer
updated.
Robert Roland
2021-03-12 15:56:22 UTC
Permalink
Post by JJ
Post by Robert Roland
It seems they have abandoned this parsing behavior somewhere along the
line. I just tested on Windows 10, which does not do it. I also tested
on Windows 2000, which does do it.
Which Service Pack version is that? Or is it a Gold / non Service Pack
version? Cause I have different results.
This was Windows 2000 Pro with no service packs or other updates.
Straight from the CD.
Post by JJ
However for Windows 2000, I only have the SP4 version. In that version, it
does not process the AUTOEXEC.BAT. Same goes to Windows NT 4.0 SP6.
I just tested NT4 Workstation.
With no service pack, with SP2 and SP3, it does parse autoexec.bat.

It seems I have not kept any other service packs.

Could there be a difference between Server and Workstation editions?

The registry value that controls this, is a string value at

HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Winlogon\ParseAutoexec

Set it to "1" to enable.
--
RoRo
mokomoji
2021-05-14 15:21:01 UTC
Permalink
Post by Tom Del Rosso
I don't think I understand this. It appears to say that autoexec.bat
can't call another batch (if called it won't be parsed) but how is that
"useful?"
https://ss64.com/nt/set.html
"If autoexec.bat CALLS any secondary batch files, the additional batch
files will NOT be parsed at boot.
This behaviour can be useful on a dual boot PC."
--
Defund the Thought Police
long long ago
ms-dos 6.22 - autoexec.bat

windows 95 - autoexec.bat - os now booting
autoexec.win - windows version booting
autoexec.dos - windows dos f8 key pause - msdos.sys setting

windows 98 - autoexec.bat - os now booting
autoexec.win - windows version booting
autoexec.dos - windows dos f8 key pause - msdos.sys setting

windows me -autoexec.bat - os now booting
autoexec.win - windows version booting
autoexec.dos - windows dos f8 key pause - msdos.sys setting

Reference document-language korean
https://blog.naver.com/mokomoji/120019159152

windows 2000 autoexec.nt, command.com program open setting
autoexec.bat cmd program open setting

windows xp autoexec.nt, command.com program open setting
autoexec.bat cmd program open setting

Reference document-language korean
https://blog.naver.com/mokomoji/130170925403

- MS vice president say - "Delete "DOS" from "Windows" in the future"
useing powershell~!!! and 16bit DOS software RIP~!!

vista - 2006/11/30
windows 7
windows 8
windows 10
2005~2006 Delete all "DOS SYSTEM" after MS WINDOWS system

Loading...