The drive is like this:


and I mapped it to H: and it works.

But when I try:



cd H:\something

it complains:

PS C:\WINDOWS\system32> H:
Set-Location : Cannot find drive. A drive with the name 'H' does not exist.
At line:1 char:1
+ Set-Location $MyInvocation.MyCommand.Name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (V:String) [Set-Location], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

Your command prompt says that you are currently working in C:\WINDOWS\system32, which suggests that PowerShell is running as an Administrator. Drive mappings are created per-user, rather than system-wide, so it's likely that the user context in which PowerShell is running does not have drive H: mapped.

Try running PowerShell as a standard user. Or, map the drive within PowerShell:

net use H: \\bigdrive\folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.