# Why am I getting invalid directory from Windows command line?

**URL:** <https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355>\
**Category:** Factual Questions\
**Created:** [October 15, 2013, 11:23pm UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355 "2013-10-15T23:23:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quintas](https://avatars.discourse-cdn.com/v4/letter/q/48db29/32.png) [@Quintas](https://boards.straightdope.com/u/Quintas)\
**Post date:** [October 15, 2013, 11:23pm UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/1 "2013-10-15T23:23:35Z")

</div>

I’m not gonna use the actual file names but im trying to get to

C:\ABCD\P\_9

From C: I’ve tried cd ABCD\P-9

I get invalid directory.

Next I tried cd ABCD. This got me to:

C:\ABCD

I did a dir and saw my P\_9 listed

So from C:\ABCD\> cd P\_9

invalid directory.

FWIW P\_9 has \<DIR\> between time and directory name.

This is WINXP SP 3

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [October 15, 2013, 11:41pm UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/2 "2013-10-15T23:41:04Z")

</div>

You may find this helpful:

[http://www.tomshardware.com/forum/248039-44-rename-invalid-directory](http://www.tomshardware.com/forum/248039-44-rename-invalid-directory)

---

<div class="post-metadata">

**Author:** ![Mithras](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mithras](https://boards.straightdope.com/u/Mithras)\
**Post date:** [October 16, 2013, 12:08am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/3 "2013-10-16T00:08:31Z")

</div>

If you type “cd P” and then hit tab does it auto-complete the directory in a usable way?

---

<div class="post-metadata">

**Author:** ![Quintas](https://avatars.discourse-cdn.com/v4/letter/q/48db29/32.png) [@Quintas](https://boards.straightdope.com/u/Quintas)\
**Post date:** [October 16, 2013, 12:15am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/4 "2013-10-16T00:15:59Z")

</div>

> [@Mithras](#):
>
> If you type “cd P” and then hit tab does it auto-complete the directory in a usable way?

No

---

<div class="post-metadata">

**Author:** ![Mithras](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mithras](https://boards.straightdope.com/u/Mithras)\
**Post date:** [October 16, 2013, 12:33am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/5 "2013-10-16T00:33:38Z")

</div>

I was able to sort of replicate this in Windows 7 by creating a directory that had a unicode character that wouldn’t display in the command line. I was able to fix it with:

move P\_9\* P9

ETA: This assumes you don’t have anything named like P\_9a, p\_92, etc.

---

<div class="post-metadata">

**Author:** ![Quintas](https://avatars.discourse-cdn.com/v4/letter/q/48db29/32.png) [@Quintas](https://boards.straightdope.com/u/Quintas)\
**Post date:** [October 16, 2013, 12:39am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/6 "2013-10-16T00:39:32Z")

</div>

I tried getting to it from another computer that has the same directory/subdirectory and I can get to it fine. I can also get to it through Windows Explorer. Just not through command line. Weird.

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [October 16, 2013, 12:48am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/7 "2013-10-16T00:48:24Z")

</div>

If you can get to it from explorer, you might want to try renaming it to something else in explorer, then name it back to what you think it should be.

---

<div class="post-metadata">

**Author:** ![Isilder](https://avatars.discourse-cdn.com/v4/letter/i/cc9497/32.png) [@Isilder](https://boards.straightdope.com/u/Isilder)\
**Post date:** [October 16, 2013, 7:38am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/9 "2013-10-16T07:38:33Z")

</div>

p\_9 means file name p, version 9

Thats one trouble with having so many fancy features (A gui that understands version numbers) and still using a CLI

---

<div class="post-metadata">

**Author:** ![Dervorin](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Dervorin](https://boards.straightdope.com/u/Dervorin)\
**Post date:** [October 16, 2013, 8:45am UTC](https://boards.straightdope.com/t/why-am-i-getting-invalid-directory-from-windows-command-line/671355/10 "2013-10-16T08:45:33Z")

</div>

> [@Polly16](#):
>
> You may find this helpful:  
> [http://www.dressfirst.com/A-Line-Princess-One-Shoulder-Floor-Length-Chiffon-Prom-Dress-With-Ruffle-Beading-018004882-g4882](http://www.dressfirst.com/A-Line-Princess-One-Shoulder-Floor-Length-Chiffon-Prom-Dress-With-Ruffle-Beading-018004882-g4882)

This really helped! I was astonished by how little I cared about renaming directories from the command line after browsing prom dresses for a few minutes.

On a slightly more seriously helpful note, I have sometimes found that Unicode characters in a path screw with the command line because it can’t interpret them and displays a ? instead. Have you tried enclosing your path name with quotes? Something like (from C:) cd “ABCD\P\_9”.

On Win8, I’m able to create a directory with a Unicode character (I chose something from the Arabic script, which makes typing really difficult because it switches direction halfway through the name) and change directory to it via the command line by typing p+tab to autocomplete. However, the character still displays as a ?.
