autoexec.bat

40 views
Skip to first unread message

Tom Del Rosso

unread,
Mar 6, 2021, 8:21:37 PM3/6/21
to
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

unread,
Mar 7, 2021, 7:31:28 AM3/7/21
to
That refers to MS-DOS environment only.
In Windows NT, AUTOEXEC.BAT is no longer part of an OS boot.

Tom Del Rosso

unread,
Mar 7, 2021, 9:36:00 AM3/7/21
to
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?

Tom Del Rosso

unread,
Mar 7, 2021, 9:42:45 AM3/7/21
to
Tom Del Rosso wrote:
> (and this is in the cmd section which should mean NT)

And the URL says nt.

JJ

unread,
Mar 7, 2021, 9:12:55 PM3/7/21
to
On Sun, 7 Mar 2021 09:35:57 -0500, Tom Del Rosso wrote:
>
> 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

unread,
Mar 8, 2021, 4:56:12 PM3/8/21
to
On Mon, 8 Mar 2021 09:12:38 +0700, JJ <jj4p...@gmail.com> wrote:

>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

unread,
Mar 8, 2021, 5:28:19 PM3/8/21
to
Robert Roland wrote:
>
> 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

unread,
Mar 9, 2021, 12:39:37 AM3/9/21
to
On Mon, 08 Mar 2021 22:56:11 +0100, Robert Roland wrote:
>
> 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

unread,
Mar 9, 2021, 4:47:10 PM3/9/21
to
On Tue, 9 Mar 2021 12:39:19 +0700, JJ <jj4p...@gmail.com> wrote:

>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

unread,
Mar 9, 2021, 11:17:48 PM3/9/21
to
On Tue, 09 Mar 2021 22:47:08 +0100, Robert Roland wrote:
>
> 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

unread,
Mar 12, 2021, 10:56:24 AM3/12/21
to
On Wed, 10 Mar 2021 11:17:28 +0700, JJ <jj4p...@gmail.com> wrote:

>On Tue, 09 Mar 2021 22:47:08 +0100, Robert Roland wrote:
>>
>> 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.

>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

unread,
May 14, 2021, 11:21:02 AM5/14/21
to
2021년 3월 7일 일요일 오전 10시 21분 37초 UTC+9에 Tom Del Rosso님이 작성한 내용:
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

Reply all
Reply to author
Forward
0 new messages