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

Updated: 11/13/2018 by Computer Hope

Windows DOS command prompt windowWhen 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\"program files"

In the first example command, cd\progra~1 goes back to the root directory by 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 is surrounding "program files" in quotes to indicate to the computer that this is one directory name.

64-Bit computers with Program Files (x86) directory

Newer computers with a 64-bit processor will 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: In new versions of Windows (e.g., Windows 7 and Windows 10), you no longer need quotes, but it is still a good idea to have quotes around any file name or directory with spaces with quotes to prevent any confusion.

Tip: Use the Tab key 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" and if you press the Tab key again, it will autocomplete "Program Files (x86)."