Cannot access network drive in PowerShell running as administrator

前端 未结 7 1966
暗喜
暗喜 2020-12-07 13:23

I\'m running PowerShell in a Windows 7 x64 virtual machine. I have a shared folder on the host mapped as a network drive (Z:). When I run PS normally I can access that drive

7条回答
  •  心在旅途
    2020-12-07 13:55

    None of the other answers worked for me; but @TimothyLeeRussell's answer pointed me in the right direction.

    In my case, I had a .bat file located on a network drive. When I ran it as administrator it would just flash a command prompt window and instantly disappear; it worked fine when I ran the file's contents from an elevated command prompt.

    Finally I realized that I tried running the .bat file from the mapped network drive. I changed the execution of the file to use the UNC path and it worked.

提交回复
热议问题