Start-Process -WorkingDirectory as administrator does not set location

后端 未结 4 682
攒了一身酷
攒了一身酷 2021-02-18 16:58

When I enter the command

Start-Process powershell -WorkingDirectory \"D:\\folder\"

it opens new PowerShell window with D:\\folder

4条回答
  •  悲哀的现实
    2021-02-18 17:34

    I also had the same problem and solved it with this command:

    Start-Process powershell.exe -verb runAs -ArgumentList '-NoExit', '-Command', 'cd D:\folder'
    

    Once you run the above command, Windows will launch with admin authority and the specified directory.

提交回复
热议问题