Path with no slash after drive letter and colon - what does it point to?
Posted
by
ya23
on Stack Overflow
See other posts from Stack Overflow
or by ya23
Published on 2014-05-30T13:38:21Z
Indexed on
2014/06/02
9:26 UTC
Read the original article
Hit count: 179
I have mistyped a path and instead of c:\foo.txt
wrote c:foo.txt
. I expected it to either fail or to resolve to c:\foo.txt
, but instead it seems to be resolved to foo.txt
in a current user's home folder.
Powershell returns:
PS C:\> [System.IO.Path]::GetFullPath("c:\foo.txt")
c:\foo.txt
PS C:\> [System.IO.Path]::GetFullPath("c:foo.txt")
C:\Users\Administrator\foo.txt
PS C:\> [System.IO.Path]::GetFullPath("g:foo.txt")
G:\foo.txt
Running explorer.exe from commandline and passing it any of the above results in C:\Users\Administrator\Documents to be opened.
I haven't found any documentation of that and I'm utterly confused, please explain the behaviour.
© Stack Overflow or respective owner