Run as different user

Started by Secondlaw, January 02, 2019, 09:01:04 AM

Previous topic - Next topic

Secondlaw

Is there an easy way to run "CMD.EXE" with, "Run as different user" (see attached).

It seems that all of the info I'm able to find has "UAC" attached to it but that's not an issue for me. 

Thanks in advanced.

td

You need to provide a lot more context.  Otherwise, you leave forum members to either post a response based on a guess at what that context might be or trying to answer the same question many times.   For example, do you want to create a WinBatch script to run cmd.exe as a different user?  Which version(s) of Windows are you planning to run cmd.exe on?  Why do you think UAC does not apply to you?
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Secondlaw

"do you want to create a WinBatch script to run cmd.exe as a different user?"
Yes!

I'd like to run "CMD.EXE" as a different user on a 64bit Win10 machine.  I've turned off UAC.

td

By "I've turned off UAC" do you mean you have set UAC to no admin prompt or do you mean you have edited the registry to completely disable UAC?  Note that if you have done the latter, you will not be able to run system apps like "Settings" and "Calculator" to name a few.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Should add that if you simply turned off UAC admin prompting on Windows 10, UAC considerations do apply to attempts to run as a different user.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Secondlaw

I've edited the registry to turn it off.

Is there a way to do this or should I look for another solution?

td

The RunWithLogon function is used to run an application as a different user.  Please see the Consolidated WIL Help file for details.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Secondlaw


td

In the future when you start a topic, please provide more context up front. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade