RunAs A different user when debugging in Visual Studio

后端 未结 7 1038
有刺的猬
有刺的猬 2020-11-29 05:21

I\'m trying to run the program I\'m debugging as a different user. Now, this can be done by running the exe and attaching from Visual Studio, but this is cumbersome.

7条回答
  •  悲哀的现实
    2020-11-29 06:05

    This works (I feel so idiotic):

    C:\Windows\System32\cmd.exe /C runas /savecred /user:OtherUser DebugTarget.Exe
    

    The above command will ask for your password everytime, so for less frustration, you can use /savecred. You get asked only once. (but works only for Home Edition and Starter, I think)

提交回复
热议问题