Repository navigation
Open
Labels
Area-FileSystem-Providerspecific to the FileSystem providerIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Description
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.SetLocationCommandIt 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.0Metadata
Metadata
Assignees
Labels
Area-FileSystem-Providerspecific to the FileSystem providerIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Activity
[-]Cannot use disk root prefixed with Windows file namespace (\\.\C:\)[/-][+]Cannot use disk root prefixed with Windows file namespace (\\?\C:\ or \\.\C:\)[/+]DHowett commentedon Feb 17, 2018
It does, however, work with
-LiteralPath.iSazonov commentedon Nov 23, 2021
Related #10805
ForNeVeR commentedon Nov 16, 2023
In modern PowerShell, it stopped working at all, nor
\\.\C:\neither\\.\C:\Windowswork now.-LiteralPathalso doesn't work.Not sure if it should be so or not?
ForNeVeR commentedon May 14, 2024
Small update:
Get-ChildItem \\.\C:\now works. Everything else is still broken as I described.ForNeVeR commentedon Nov 11, 2024
I am so sorry but this is still broken, the issue still exists :(
ForNeVeR commentedon May 10, 2025
I am unhappy with this robot trying to close valid bug reports, and I will not surrender. Just re-checked on 7.5.1 and the issue is still present.