We have Win7 machines on a domain that we'd like to open the "Programs and Features" control applet via the command line while a regular user is logged in.
Here's the catch: I know how to do this using runas from the command line BUT after "Programs and Features" opens, I don't truly have the ability to remove a program. I am told that I need to be an Admin to do so. Here are the commands I have tried:
runas /user:%computername%\administrator cmd.exe then in the new cmd window running: control appwiz.cpl
runas /user:%companydomain%\%domainadminacct% cmd.exe then in the new cmd window running: control appwiz.cpl
runas /user:%computername%\administrator cmd.exe then in the new cmd window running: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl
runas /user:%companydomain%\%domainadminacct% cmd.exe then in the new cmd window running: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl
I have also tried all of the above as one long line of code instead of launching a cmd.exe as Admin
As you can see, I have tried running the command using both a local admin account (Administrator) AND a domain admin account. I have also tried launching the runas command as one long command (opening the "programs and features") AND 1st launching a cmd.exe with admin rights and THEN launching the "Programs and Features" window. The result is the same: The "Programs and Features" windows opens but when I try to perform an uninstall, I am told I need Admin rights. Thus I am lead to believe that this instance of "Programs and Features" is not truly being run as an admin.
I am trying to avoid logging the regular user out. I am also aware that every program has its own uninstaller, I do not want to uninstall that way. I want to use the uninstaller in "Programs and Features". Any help is appreciated.
Best Answer
Is there any particular reason you're trying to do this from the command-line as opposed to built-in features available in the UI? Also, might there be a system policy that's preventing you from performing these operations?
Here's a suggestion using the UI:
appwiz.cpl
.appwiz.cpl
to appear in the search results. There should be only one entry at the top, under "Programs". It should have a document icon with some gears on it, and should be automatically highlighted.appwiz.cpl
highlighted in the search results, press CTRL+SHIFT+ENTER. This will force Windows to attempt executingappwiz.cpl
with Administrator privileges.If the above does not work, there may be an issue with your system's Security Policy. Do the following to check:
secpol.msc
and hit ENTER.User Account Control: Behavior of the elevation prompt for standard users
Automatically deny elevation requests
, you will not be able to use Administrator permissions while running under a standard user account.Prompt for credentials...
settings, and the above process for runningappwiz.cpl
elevated still does not work for you, then you may have a different problem.