Home » Questions » Computers [ Ask a new question ]

Why can't you type `C:folder\subfolder` into Run box?

Why can't you type `C:folder\subfolder` into Run box?

I stumbled across these apparent inconsistencies long ago but never came to an acceptable explanation about how it all worked. All of these can be typed into the Start > Run box on Windows XP.

Asked by: Guest | Views: 451
Total answers/comments: 2
Guest [Entry]

"I just tested it and it worked fine. The biggest thing you need to check is the current directory explorer is using. It should be your home directory (in my case here at work it is H:).

In order for the C:folder\subfolder syntax to work, folder must be under the current working directory for explorer.

In my case, I have H:\tests, H:\tests\200930, and H:\tests\200940 and running

H:tests\200940

worked as expected.

I guess you need to make sure that subfolder is there and that folder\subfolder is under your working directory for explorer.

You can view the current directory for explorer using the Process Explorer tool from Sysinternals. Once you run Process Explorer, find Explorer.exe, double click on it, and look at the current directory.

You can actually confirm this behavior yourself by using the command prompt and trying the following (note, you'll need at least two drives to test this)

H:\> dir
...
Directory of H:\
2009-08-26 09:13 <DIR> Tests
...
H:\> cd Tests
H:\Tests> c:
C:\> dir H:
...
Directory of H:\Tests
2009-08-26 09:13 <DIR> 200930
2009-08-26 09:24 <DIR> 200940
...
C:\> dir H:200940
...
Directory of H:\Tests\200940
...
C:\> cd Windows
C:\Windows> H:
H:\Tests> dir C:System32
...
Directory of C:\WINDOWS\System32
...

(the ... is cut data that isn't relevant)

As you can see the drive:directory syntax is highly relevant to the current working directory of each drive. In the case of explorer, it is reliant on the current working directory for your user and the root of every other drive.

So while my home directory is H:\ I can use the H:directory syntax to get to any folder under my home directory, but if I use C:directory I am limited to the root of that drive."
Guest [Entry]

"The difference between path that is working and the one that is not is in the fact there are spaces in the name. If you were to put the complete name (without backslash after colon) in quotes and try to open it you will get the same error as with folders that don't contain spaces.

For directly opening folder it works both ways, for opening a path that contains subfolder it doesn't.

So for example this will work (if the folders exist of course):

c:folder with a long name\subfolder
c:folder-with-a-long-name-without-spaces

while this won't:

c:folder-with-a-long-name-without-spaces\subfolder
""c:folder with a long name\subfolder""

I searched for an explanation but so far failed to find one."