How do I get into the program files directory in DOS?

Updated: 11/13/2018 by Computer Hope
Windows DOS command prompt window

When accessing the Program Files directory from the command line of an early version of Windows, you may encounter an error such as "Invalid number of parameters." This error is often caused by the lack of support for long file names. To get around this error, use the 8.3 file format or surround the directory in quotes, as shown in the examples below.

cd \progra~1

or

cd "\program files"

In the first example command, cd \progra~1 goes back to the root directory using "cd\" and then from root goes into the 8.3 file format name of "program files." Once run, your prompt should be changed to "C:\PROGRA~1." The second example is similar to the first example, but it's surrounding "program files" in quotes to indicate to the computer it's one directory name.

Tip

When you work on the command line with file names or directory names containing spaces, surround the entire name with quotes. If you don't, the OS interprets the space as a separator between command arguments.

64-bit computers with Program Files (x86) directory

Newer computers with a 64-bit processor have two Program Files directories: one Program Files directory for 32-bit programs and the other for 64-bit programs. To get into the "Program Files (x86)" directory for 32-bit programs, type the following command.

cd "\program files (x86)"
Tip

Use the Tab to autocomplete directory names. For example, if you're at the C:\> prompt, type cd pro and press the Tab key to autocomplete "Program Files." If you press Tab again, it autocompletes "Program Files (x86)."