Please feel free to provide feedback or file bugs here.

[BUG] "Start-Process -Verb runas" overrides working directory to System32

PowerShell's Start-Process cmdlet (aliased as "start") has the very useful "-Verb" parameter, which can be used to launch a process as Administrator ("-Verb runas") the same way as if you selected "Run as Administrator" from the context menu, which has several advantages over approaches such as the "runas" command in CMD or similar (in particular, in UAC Admin Approval Mode, it lets you elevate from limited to Admin privileges without needing to change users to BUILTIN\Administrator or similar).

However, there's a bug in this parameter's behavior: it changes the command's working directory to the System32 directory for any program itself located in System32. It does this regardless of the current directory, or even of the "-WorkingDirectory <dir>" argument to Start-Command. This means you cannot, for example, launch CMD.EXE to any directory other than System32.

Programs located elsewhere work correctly (for example, if I copy cmd.exe to a non-System32 location and start the copied file, the working directory is inherited or set as expected).

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    CBHacking shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base