I'm a member of administrators group on Windows 7. I need to run
foo.exe from a Cmd or Powershell. The exe file requires elevation to work but the elevation is not specified in its manifest.
Usually I have to do
start . to open Explorer, right-click the exe and select Run as administrator.
Is there an easier way? I'm not going to turn UAC off, I don't want to have the password remembered passwords or to avoid the prompt. I just want to avoid the need to launch the Explorer window.
I'm a member of administrators group. I don't want to run as another user, I only want to see the passwordless UAC prompt I see when I do myself when right clicking in Explorer, but without opening the explorer, running third-party tools, disabling UAC, ability to do the same from scripts or remembering credentials.
I just want to invoke the usual UAC prompt without an intermediate step.
To clarify, I want the following sequence:
Windows 7, UAC on, I'm in administrators group, UAC prompt is set to answer yes/no.
Open a non-elevated command prompt and navigate to a deep folder and do other tasks.
I run 'elevate-command-sequence foo.exe' and an UAC prompt opens exactly the same way it opens when I right-click in Explorer. Current directory for foo.exe is set to the deep folder I'm in.
I wonder if such
elevate-command-sequence exists in cmd or powershell out of the box.