5

So this is an odd one...

I need to run the 64-bit version of command prompt/powershell as non-admin. Unfortunately, no matter what I try, it will only run in elevated mode.

From what I've seen, in the system32 folder cmd and powershell are set to run as admin upon open while in the sysWOW64 folder they run fine. While the 32-bit works, it does not work for the script I need to run; therefore, I need the 64-bit command line to work.

  • OS: Windows 7 64-Bit Enterprise

  • Domain computer

  • Domain GPO is not the issue, as this is the only computer with the problem.

What I've tried:

  1. "Disabling" UAC, and while it no longer prompts it still only runs as admin, which doesn't help as I need to run it in a non-elevated mode.

  2. Run as different user, leads to access error (i.e. not able to open command line program, as admin needed)

  3. Compatibility mode is grayed out, but even checking the settings it is not set to run as admin.

  4. Shortcuts also open it up automatically in elevated mode. So problem lies in the target location, and changing the shortcut does not fix the issue.

Is there a way to allow it to run as a regular user?

user997967
  • 51
  • 2
  • How are you starting Powershell? Is the shortcut you're using set to always elevate? Is the issue that when you open PS "normally" it always prompts, or that it does not open UNLESS you open it with elevated permissions? – music2myear Feb 13 '19 at 18:32
  • I don't know if this is the same thing, but it's similar and worth reading: https://superuser.com/questions/463434/powershell-has-started-running-as-administrator – music2myear Feb 13 '19 at 18:34
  • I'm running Powershell from the start menu by searching it. It is the direct exe file (not a shortcut), and automatically runs in elevated upon open. Upon searching it it shows that the little window shield the signifies "Run as admin" – user997967 Feb 13 '19 at 18:35
  • [Windows 7 Run as non admin user from command prompt - Server Fault](https://serverfault.com/questions/129741/windows-7-run-as-non-admin-user-from-command-prompt) – DavidPostill Feb 13 '19 at 18:39
  • What about this? Maybe you can find your solution [here](https://superuser.com/a/979382/898874) – lucaortis Feb 13 '19 at 18:40
  • I think you should read over [How User Account Control works - Request execution levels](https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/how-user-account-control-works#request-execution-levels) as the executable likely needs to be fixed and then recompiled if the disabling of UAC is not sufficient. I've seen this before so I wanted to mention, I just had the developer update the code and recompile a new executable to resolve. I guess just FYI if nothing else. – Vomit IT - Chunky Mess Style Feb 13 '19 at 18:43
  • The default behavior searching from the Start Menu finds the shortcut, not the PowerShell exe. Right-click on the item found in the Start Menu and click Open File Location to confirm the file/shortcut that was found. If it is the shortcut, right-click on it, select Properties, and click the Advanced button. Check to see if it is set to always run as administrator. Or check for the same setting in the Compatibility tab. – music2myear Feb 13 '19 at 18:44
  • @music2myear I thought so too. Default on this appears that it is not a shortcut though. But even running your way it only runs as admin. :( – user997967 Feb 13 '19 at 18:51
  • @Pimp Juice IT The issue isn't with the exe (at least entirely). The issue is running command line tools, as they default to elevated, when I need it to run as non-elevated. – user997967 Feb 13 '19 at 18:51

1 Answers1

4

So figured it out after trial and error.

Apparently, it was just something in an unstable state with UAC.

I disabled UAC, and then restarted. I then re-enabled UAC at max level then restarted again and it worked.

Doug Deden
  • 1,989
  • 1
  • 10
  • 16
user997968
  • 41
  • 1