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.
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.
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.
cd “\program files (x86)”
Use Tab to autocomplete directory names. For example, if you’re at the C:> prompt, type cd pro and press Tab to autocomplete “Program Files.” If you press Tab again, it autocompletes “Program Files (x86).”
Related information
- How to use the Windows command line (DOS).
- Why do I have two Program Files folders?
- Information on long file names.
- See our Windows command line and MS-DOS definitions for further information links.
- Windows command line help and support.