Razorback
NewsProjectsGuidesResourcesContact
 Guide Index Quick Links


UpdateAutoBat and UpdateCfgSys

Created on March 10, 2023

Contents
  1. UpdateAutoBat
  2. UpdateCfgSys

This page is only useful for those working with Windows 95 and 98, and has no relevance in Windows NT. You can skip this page if desired.

Windows 95's 16-bit setup engine has the capability of altering the AUTOEXEC.BAT and CONFIG.SYS files that were used to initialize MS-DOS. The setup routines in Windows 95 and 98 primarily use this to remove some real mode drivers and TSRs from startup in favor of new 32-bit protected mode drivers.

Some drivers make use of this feature as well by adding in some lines to aid in compatibility with MS-DOS programs. For example, a sound driver may load some programs to ensure ideal operation of a sound card when the user is running software in MS-DOS mode.

You may not be using these often, so I'll only go over them briefly.

UpdateAutoBat

Under this type of section, you'd write down multiple fields or keys containing data just as would be applied in an ordinary INI file. You can use this section to add or remove commands from AUTOEXEC.BAT or unset environment variables.

The usage of this section works like this, taken straight out of the Windows 95 Resource Kit:

[update-autoexec-section]
CmdDelete=command-name
CmdAdd=command-name[,command-parameters]
UnSet=env-var-name
PreFixPath=ldid[,ldid]
RemOldPath=ldid[,ldid]
TmpDir=ldid[,ldid]

Multiple CmdAdd, CmdDelete, and UnSet entries can be specified in a section, but the rest can only be used once. CmdDelete entries are processed before CmdAdd entries.

We'll apply this in our INF with the following text:

[DefaultInstall]
CopyFiles=Files.Copy
AddReg=New.Reg
UpdateInis=New.Ini
UpdateAutoBat=New.AutoBat

[New.AutoBat]
CmdAdd=edit.com

What this will basically do is load the MS-DOS Editor bundled with Windows 95 during bootup. This program is located in the Command directory, which is usually C:\WINDOWS\COMMAND (where most of the DOS programs went after MS-DOS 6.x). Running the editor in AUTOEXEC.BAT is useless and annoying, but you can't ignore it, so it at least makes a good indicator that the entry worked.

This is dumb. I hate it!

But I really don't want this program to annoy me like that every time I reboot. So, in the uninstallation section, we should remove this command with this line:

CmdDelete=edit.com

It works just like that. However, CmdDelete has an undocumented flag you can use to REM, or comment out a line containing the command instead.

CmdDelete=edit.com,1

This will change the line to look like this:

rem - By Windows Setup - edit.com

This flag is mostly used by Windows 95 Setup for certain commands where commenting out a command in AUTOEXEC.BAT may be better than deleting it outright, such as when a real mode network driver is replaced with a brand new enhanced mode driver and an experienced user ought to know why their real mode network initiator no longer starts.

The other options that can be used in this section are really not made clear and don't look useful either way. For example, PreFixPath is only used twice in all of the INF files used by Windows 95 Setup, specifically SETUPC.INF. Mostly you'll only want to add and remove commands, so we'll leave it at that.

UpdateCfgSys

A section of this type is used to modify CONFIG.SYS, as the name would imply. The types of entries that can be used here are as listed in the Windows 95 Resource Kit:

[update-config-section]
DevRename=current-dev-name,new-dev-name
DevDelete=device-driver-name
DevAddDev=driver-name,configkeyword[,flag][,param-string]
Stacks=dos-stacks-values
Buffers=legal-dos-buffer-value
Files=legal-dos-files-value
LastDrive=legal-dos-lastdrive-value

This functionality really would've been a lot more useful had it existed during the prime of MS-DOS, but in any case, let's get the file populated...

[DefaultInstall]
CopyFiles=Files.Copy
AddReg=New.Reg
UpdateInis=New.Ini
UpdateAutoBat=New.AutoBat
UpdateCfgSys=New.Cfg

[New.Cfg]
Files=30
Buffers=40
LastDrive=Z
DevAddDev=oakcdrom.sys,DEVICE,,/d:mscd0001

[New.AutoBat]
CmdAdd=mscdex.exe,/d:mscd0001

This sets a couple of performance optimizations for MS-DOS mode, as well as load a real mode IDE CD-ROM driver OAKCDROM.SYS. It's assumed that this driver file is located in the root directory.

DevAddDev is poorly explained in the Resource Kit, so I'm going to deconstruct it: the line we're going for is DEVICE=oakcdrom.sys /d:mscd0001, which is accomplished by first specifying the driver name, OAKCDROM.SYS, then the keyword the driver is prefixed with, DEVICE. No flags are set, and the parameter /D:MSCD0001 is given to it so MSCDEX.EXE can call upon it to finish loading the CD-ROM driver.

For good measure, let's ensure the real mode driver is unloaded from our startup files when uninstalling:

[Uninstall]
UpdateAutoBat=Uninstall.AutoBat
UpdateCfgSys=Uninstall.Cfg

[Uninstall.AutoBat]
CmdDelete=mscdex.exe,1

[Uninstall.Cfg]
DevDelete=oakcdrom.sys

You cannot comment out devices using UpdateCfgSys; the lines can only be removed.

Unfortunately, this function was poorly thought out, as the program won't even allocate enough bytes to print out, say, a complete path to your device. I've tried loading the CD-ROM driver from the Windows and Command directories, didn't work. UpdateAutoBat and UpdateCfgSys existed more as tools for transitioning away from MS-DOS, and are not suited for the DOS enthusiast.

Furthermore, those lines I specified for buffers and what not seem to have not appeared in CONFIG.SYS when I ran it. I don't know if it just sets them somewhere else or the entries really have no effect at all. In practice, most INFs will only be deleting a bunch of startup lines to make room for good 32-bit stuff.


Comments

flatrute - March 17, 2023 at 10:29 AM

There are a few specification documents on the compression algorithm which in theory would let me be able to build a replacement that scales better on modern systems but I am so busy in college at the time I am typing this...

1 comment on this page

Sort: Ascending | Descending

Leave a Comment

Name: (required)

Website: (optional)

Maximum comment length is 1000 characters.
First time? Read the guidelines

SORRY NOT GONNA SHOW THIS IN TEXT BROWSER
Enter the text shown in the image: