How to access an MS-DOS or Windows Command Line

I would like to say hi!

The methods below show how to access an MS-DOS prompt or the Windows command line.

Windows 11 and 10

  1. Press the Start button.
  2. Enter cmd into the command prompt and press Enter.

Some commands and arguments in the Windows 10 or 11 command line require administrator access to be executed.
Right-click the cmd icon and choose Run as administrator.

Getting to MS-DOS

If you are only running MS-DOS, the computer should boot into an MS-DOS prompt automatically, unless you have a shell or another software loading automatically.

If the computer is unable to load MS-DOS, restart it and, while it is booting, hit the F5 key when you see the message Starting MS-DOS or the MS-DOS version.
By pressing this key, the MS-DOS default settings should be loaded.

If this results in an MS-DOS prompt and you wish to prevent it from happening again, update the autoexec.bat or config.sys files and mark any problematic lines.

Getting to MS-DOS in Windows 3.x

If you’re running Windows 3.x, the machine is probably booting into Windows automatically and skipping the MS-DOS interface.
If the machine boots successfully into Windows, to exit to an MS-DOS prompt, from the Program Manager, click the file menu and pick Exit.

If the computer is unable to load MS-DOS, restart it and, while it is booting, hit the F5 key when you see the message Starting MS-DOS or the MS-DOS version.
By pressing this key, the MS-DOS default settings should be loaded.

If you do not want Windows 3.x to load automatically, delete the win line from the autoexec.bat file.

Other types of operating systems

If you need a command line, you’ll most likely want to use your operating system’s Shell or Terminal, not MS-DOS.

Unless you are dual booting the computer, use an MS-DOS boot diskette if you are using another operating system like OS/2 or a Linux derivative, and need to go to an MS-DOS prompt.
Remember that booting from an MS-DOS diskette will not allow you to access files used by other operating systems.
However, if you’re wiping everything and starting again, this will allow you to wipe all previous data and begin again.