0

The drive is like this:

\\bigdrive\folder

and I mapped it to H: and it works.

But when I try:

H:

or

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
bluesquare
  • 357
  • 1
  • 7
  • 18

1 Answers1

2

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
toryan
  • 931
  • 7
  • 19
  • Great that exactly it. Do you know if Windows has a system-wide way to map a drive? – bluesquare Oct 23 '20 at 22:00
  • https://superuser.com/questions/841949/how-do-i-map-a-network-drive-so-that-any-user-that-logs-in-the-pc-could-see-it-i – toryan Oct 23 '20 at 23:43