How to fix the bad command or file name boot error

Updated: 04/02/2019 by Computer Hope

To resolve the "bad command or file name" error on boot, you must first determine what line in your autoexec.bat and config.sys is causing the issue. To do this, we recommend doing the Step-by-step configuration option in the Windows Startup menu.

Microsoft Windows 98 Startup Menu
=============================

1. Normal
2. Logged (\BOOTLOG.TXT)
3. Safe mode
4. Step-by-step confirmation
5. Command prompt only
6. Safe mode command prompt only

Enter a choice: 1

F5=Safe Mode Shift+F5=Command prompt Shift+F8= Step-by-step confirmation [N]

To get into this menu, press F8 over and over as the computer is booting or when you see the computer indicate Microsoft Windows is starting.

In the startup menu, choose option 4 for step-by-step confirmation. Once chosen, the computer prompts you to say Yes or No to each command loaded for your computer. Say yes to each of these commands until you get the error. Once the error occurs, write down the line.

Once in Windows, edit the autoexec.bat and config.sys, locate the bad command file name, and fix it, or type "REM " (with the space) to remark the line.