Windows 98 Command.com Startup Switches

Microsoft Windows 98 relies on COMMAND.COM as its primary 16-bit command interpreter, handling the MS-DOS prompt and processing initialization batch files. When diagnosing boot failures, memory allocation issues, or batch script errors, several command-line switches can be appended to the COMMAND.COM startup line to alter its behavior. This guide details the specific diagnostic and troubleshooting switches available for COMMAND.COM in Windows 98 and explains how to apply them.

Step-by-Step Script Execution: /Y

The /Y parameter is the primary diagnostic switch for batch file execution in Windows 98. When combined with the /C or /K parameters, /Y forces COMMAND.COM to step through the specified batch program line-by-line, prompting the user for confirmation before executing each command.

If /Y is used alongside the /P (permanent) switch during the boot sequence, it instructs the interpreter to prompt before executing each line of AUTOEXEC.BAT. This allows administrators to pinpoint the exact line or terminate-and-stay-resident (TSR) program causing a crash or system lockup.

Critical Error Handling: /F

The /F switch automatically answers "Fail" to any system-level critical errors (such as the standard "Abort, Retry, Fail?" prompt). In diagnostic scenarios, adding /F prevents the command interpreter from hanging indefinitely when attempting to access unreadable media or missing storage drives, allowing automated diagnostic routines to continue or fail gracefully without user intervention.

Memory-Resident Error Messages: /MSG

The /MSG switch forces COMMAND.COM to store all internal error messages in conventional memory rather than reading them from the physical disk drive. This is useful when troubleshooting systems with failing hard drives, corrupt system files, or systems booting entirely from read-only media or floppy disks. The trade-off is a slight increase in conventional memory usage.

Return Code Tracking: /Z

In MS-DOS 7.1 (the underlying DOS version of Windows 98), the undocumented /Z switch can be used for error-level diagnostics. When enabled, COMMAND.COM displays the return code (errorlevel) returned by external programs immediately after they finish executing, eliminating the need to write separate batch scripts checking IF ERRORLEVEL statements.

Expanding Environment Space: /E:size

Running out of environment space often causes configuration variables to truncate, resulting in silent failures during software initialization. The /E switch sets the memory size allocated for environment variables, where size can range from 256 to 32,768 bytes. The default allocation is 256 bytes. Increasing this value (e.g., /E:2048 or /E:4096) resolves the common "Out of environment space" error encountered during complex boot routines.

Preserving Debug Output: /K

The /K switch executes a specified command or batch file and leaves the command interpreter active. For diagnostics, this ensures that the MS-DOS prompt window does not close automatically after executing a troubleshooting script, allowing users to review generated error logs, driver loading messages, and screen output.

Applying Diagnostic Switches

To apply these switches globally at boot time, modify the SHELL directive inside CONFIG.SYS:

SHELL=C:\WINDOWS\COMMAND.COM C:\WINDOWS /P /E:2048 /Y

For diagnostic testing within an active Windows 98 session, append the switches directly to the target field in the MS-DOS Prompt shortcut properties or execute them directly from the Run dialog box.