Start-Process -WorkingDirectory as administrator does not set location

后端 未结 4 665
攒了一身酷
攒了一身酷 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:37

    Once you run Powershell as administrator;

    user the push-location command like so:

    Push-Location -Path C:\
    

    or put it into your script and run the script from the elevated Powershell prompt.

提交回复
热议问题