Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use disk root prefixed with Windows file namespace (\\?\C:\ or \\.\C:\) #6149

Open
ForNeVeR opened this issue Feb 13, 2018 · 3 comments
Labels
Area-FileSystem-Provider specific to the FileSystem provider Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif WG-Engine-Providers built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

Comments

@ForNeVeR
Copy link
Contributor

ForNeVeR commented Feb 13, 2018

Steps to reproduce

NOTE: it works the same for \\?\C:\ and \\.\C:\.

$ Set-Location \\.\C:\
Set-Location : An object at the specified path \\.\C: does not exist.
At line:1 char:1
+ set-location \\.\C:\
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Set-Location], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetLocationCommand
$ Set-Location \\.\C:\Windows # this works
$ Set-Location ..
Set-Location : Cannot find path '\\C:' because it does not exist.
At line:1 char:1
+ Set-Location ..
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (\\C::String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

It doesn't work with Get-ChildItem either: Get-ChildItem \\.\C:\ throws an error and Get-ChildItem \\?\C:\ returns an empty list. It may be a separate issue.

Expected behavior

It should work and set the current location to C:\. Notably, the following works in cmd:

$ dir \\?\C:\
 Volume in drive \\?\C: is SSD
 Volume Serial Number is 6666-СССС

 Directory of \\?\C:

05.01.2018  17:01    <DIR>          .conan
...

Actual behavior

It doesn't work.

Environment data

$ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0
PSEdition                      Core
GitCommitId                    v6.0.0
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@ForNeVeR ForNeVeR changed the title Cannot use disk root prefixed with Windows file namespace (\\.\C:\) Cannot use disk root prefixed with Windows file namespace (\\?\C:\ or \\.\C:\) Feb 13, 2018
@iSazonov iSazonov added Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif WG-Engine-Providers built-in PowerShell providers such as FileSystem, Certificates, Registry, etc. labels Feb 13, 2018
@DHowett
Copy link

DHowett commented Feb 17, 2018

It does, however, work with -LiteralPath.

(libra) ~ % Set-Location -LiteralPath "\\?\C:\"
(libra) \\?\C:\ % gi .

\\?

d--hs-        2/15/2018   5:45 PM                \\?\C:\


(libra) \\?\C:\ % Get-ChildItem -LiteralPath "\\?\Volume{8c2cd5c6-7a2e-4004-92cd-df850828d9b6}\"

\\?\Volume{8c2cd5c6-7a2e-4004-92cd-df850828d9b6}

d-----        10/2/2017   1:13 PM                Recovery

@iSazonov
Copy link
Collaborator

Related #10805

@iSazonov iSazonov added the Area-FileSystem-Provider specific to the FileSystem provider label Nov 23, 2021
@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-No Activity Issue has had no activity for 6 months or more labels Nov 16, 2023
@ForNeVeR
Copy link
Contributor Author

In modern PowerShell, it stopped working at all, nor \\.\C:\ neither \\.\C:\Windows work now. -LiteralPath also doesn't work.

Not sure if it should be so or not?

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Resolution-No Activity Issue has had no activity for 6 months or more label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FileSystem-Provider specific to the FileSystem provider Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif WG-Engine-Providers built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Projects
None yet
Development

No branches or pull requests

3 participants