2

I have UAC disabled on my system, and all command prompts start as elevated ("Administrator: ..."). Even if I start cmd.exe from the Start Menu, it's still elevated.

Is there a way to run a non-elevated command prompt somehow?

I need that so that I can fix a bug in some software which doesn't work properly unless running as admin.

1
  • This works: runas /trustlevel:0x20000 <program>
    – Al Dass
    Nov 4, 2023 at 17:57

4 Answers 4

2

Sysinternals to the rescue! There is an option added some time ago to run a command as a limited user.

    Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] cmd [arguments]


-d  Don't wait for application to terminate. Only use this option for non-interactive applications.
-e  Does not load the specified account's profile.
-f  Copy the specified program to the remote system even if the file already exists on the remote system.
-i  Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.
-l  Run process as limited user (strips the Administrators group and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.

Specifically I'm recommending running

psexec -i -d -l "your command here"

This will run the command interactively, (so you can see the results) detached, (so the command line returns immediately -- not strictly necessary), and as a limited user.

1

You could remove your username from the administrator group on the computer, or create another account without admin rights.

1

The following command will run the program without elevation nor as a limited user. In other words, the integrity level will be medium instead of high or low.

psexec -u %USERDOMAIN%\%USERNAME% -p password command arguments

Adding -l will run the program as a limited user (i.e. integrity level low).

1
  • good but how to avoid the use of password?
    – Anixx
    Jun 9, 2016 at 18:23
0

As far as I know, you cannot "unelevate" a process.

If you start cmd.exe from another application (a non-elevated one), it shouldn't start as admin.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .