Discussion:
"This task will be created with administrative privileges."
(too old to reply)
Don Kuenz, KB7RPU
2019-08-14 18:30:08 UTC
Permalink
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?

Adhoc research indicates that although W7P defaults to RunAsAdmin mode,
it's hit-or-miss with W10P, and not available on W16S. Various websites
returned by Inet searches suggest policy tweaks using secpol.msc,
gpmc.msc, etc., that ultimately fail. At least one website advocates
setting bit 6 of byte 0x15 in Run.lnk to force Shortcut->Advanced->
"Run As Administrator." That too fails.

Thank you, 73,
--
Don Kuenz KB7RPU
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.
VanguardLH
2019-08-14 20:28:40 UTC
Permalink
Post by Don Kuenz, KB7RPU
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?
Adhoc research indicates that although W7P defaults to RunAsAdmin mode,
it's hit-or-miss with W10P, and not available on W16S. Various websites
returned by Inet searches suggest policy tweaks using secpol.msc,
gpmc.msc, etc., that ultimately fail. At least one website advocates
setting bit 6 of byte 0x15 in Run.lnk to force Shortcut->Advanced->
"Run As Administrator." That too fails.
Is UAC turned on or completely off?
Are you logged into a Windows account that has administrator privileges?

There is a keyboard shortcut. Use Win+R to enter the command line but
don't yet hit Enter. Use Ctrl+Shift+Enter and confirm the UAC prompt to
run, and it runs with admin privs. The default will still be to run the
program without admin privs (unless Windows protection triggers the UAC
prompt, like for regedit.exe), so you'll have to remember to use
Ctrl+Shift+Enter in the Win+R dialog when you want a normally non-admin
program to instead run with admin privs.

In Windows 10, you can use its Task Manager. After opening Task
Manager, use its File -> New Task menu. That dialog includes an option
to run with admin privs.

I have the Home edition, so no policy editors to check if the following
would help you. You said you have the Pro edition (which I assume you
meant by "W10P"). Run secpol.msc. Navigate to Local Policies ->
Security Options -> "User Account Control: Use Admin Approval Mode for
the built-in Administrator account", and enable it. If that doesn't
work, see what happens when you disable the "User Account: Run all
administrators in Admin Approval Mode". After changing the policy, and
to effect the registry change, logout and back in or reboot (don't
remember which is needed). All policies are registry entries.
According to someone else, they say the 2nd policy mentioned above
effects the following registry entry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Data item: EnableLUA
Data value: 0 or 1 (disable the enable, enable the enable).

You could also click on the search icon in the taskbar and enter cmd.
For the Command Prompt item, there is a right-pane of options, like Run
as Administrator. Alternatively, load Task Manager, open its File menu,
and hold down the Ctrl key when clicking on New Task. Load cmd w/admin
privs, and then enter whatever program you want to run w/admin privs.
If the program is listed in the Start menu, hit the Win key alone to get
the Start menu and start entering the name of the program. A right-pane
will show the option to run as admin (although there may be so many
options in the jump list that you'll have to click on the downward
chevron to see the run as admin entry).

If you want a program to always run with admin privs, right-click on it
in File Explorer, select Properties from the context menu, select the
Compatibility tab, optionally select "Change settings for all users" if
you want all users to get admin privs on this program, select "Run with
administrative privileges", and Apply and okay your way out.
Alternatively, and if you have a shortcut to the program on your
desktop, right-click on the shortcut, Properties, Compatibility tab, and
select to run with admin privs. When you use Win+R finds the shortcut
and will run that shortcut's program under its Compatibility settings.
If the program is in the alphabetical list in the Start menu, you can
right-click on the program's entry there, select More, and run with
admin privs (but this method is temporary when you load that instance of
the program).

Batch files (.bat) will have no Compatibility tab. You'll have to
create a shortcut to them, set Compatibility on the shortcut to run with
admin privs, and use the shortcut. Some old programs, like those for
XP, won't have a compatibility tab, or the program set to use admin
privs is used to load another program which doesn't start with admin
privs (games do this for protection). You can use the Windows
Application Compatibility Toolkit to create an application compatibility
shim (https://www.microsoft.com/en-us/download/details.aspx?id=7352). I
have an old game that must run under Windows XP compatibility mode which
results in the UAC prompt appearing. I could use ACT to eliminate the
prompt (without disabling UAC) but the nuisance hasn't been bad enough
for me to expend the effort to create the shim for this old game. Also,
you cannot mark system programs or processes to always run with admin
privs. That option is only available for non-system programs.
Don Kuenz, KB7RPU
2019-08-14 20:43:42 UTC
Permalink
Post by Don Kuenz, KB7RPU
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?
Allow me to restate my question. Although lots of different ways exist
to run a task with administrative privileges, my goal is to arrange for
this specific Run dialog:

Loading Image...

to popup whenever WinKey-R is pressed. Note how no additional steps are
necessary. Note the shield on the dialog.

Thank you, 73,
--
Don Kuenz KB7RPU
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.
VanguardLH
2019-08-15 04:19:46 UTC
Permalink
Post by Don Kuenz, KB7RPU
Post by Don Kuenz, KB7RPU
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?
Allow me to restate my question. Although lots of different ways exist
to run a task with administrative privileges, my goal is to arrange for
http://i.stack.imgur.com/32hqo.png
to popup whenever WinKey-R is pressed. Note how no additional steps are
necessary. Note the shield on the dialog.
Thank you, 73,
And some of my suggestions addressed that. Did you try them?
Don Kuenz, KB7RPU
2019-08-15 04:44:55 UTC
Permalink
Post by VanguardLH
Post by Don Kuenz, KB7RPU
Post by Don Kuenz, KB7RPU
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?
Allow me to restate my question. Although lots of different ways exist
to run a task with administrative privileges, my goal is to arrange for
http://i.stack.imgur.com/32hqo.png
to popup whenever WinKey-R is pressed. Note how no additional steps are
necessary. Note the shield on the dialog.
And some of my suggestions addressed that. Did you try them?
Did your read my OP?

Let's try this a different way.

When the domain Administrator is logged into a W10P device with UAC
completely disabled, turned all the way down, WinKey-R is hit-and-miss.
On some devices it displays the shield, on others it doesn't.

Ctrl-Shift-Enter accomplishes nothing from the Run dialog.

The goal is to have WinKey-R simply show the shield, and avoid all Task
Manager, Start Menu, shortcut, cmd, etc. rigmarole.

Policy edits fail. Hacks fail.

Thank you, 73,
--
Don Kuenz KB7RPU
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.
Don Kuenz, KB7RPU
2019-08-15 15:47:19 UTC
Permalink
Post by VanguardLH
Post by Don Kuenz, KB7RPU
Post by Don Kuenz, KB7RPU
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?
Allow me to restate my question. Although lots of different ways exist
to run a task with administrative privileges, my goal is to arrange for
http://i.stack.imgur.com/32hqo.png
to popup whenever WinKey-R is pressed. Note how no additional steps are
necessary. Note the shield on the dialog.
And some of my suggestions addressed that. Did you try them?
Did your read my OP?

Let's try this a different way.

When the domain Administrator is logged into a W10P device with UAC
completely disabled, turned all the way down, WinKey-R is hit-and-miss.
On some devices it displays the shield, on others it doesn't.

Ctrl-Shift-Enter accomplishes nothing from the Run dialog.

The goal is to have WinKey-R simply show the shield, and avoid all Task
Manager, Start Menu, shortcut, cmd, etc. rigmarole.

Policy edits fail. Hacks fail.

Addendum:

Further research shows that things work for an Administrator logged on
at the console. The shield appears on W16S when WinKey-R is pressed and
Ctrl-Shift-Enter elevates the task from W10P's Run dialog.

It turns out that a Remote Desktop qualifier needs to be appended on my
original question so that it becomes:

How to configure W10P and W16S to consistently display a
shield along with "This task will be created with
administrative privileges." when WinKey-R is entered /from
a Remote Desktop session/?

A couple of workarounds suggest themselves:

1. mstsc /admin
2. Determine if there's a RD key combo analogous to Ctrl-Alt-End, which
is interpreted as Ctrl-Alt-Del on the remote end of a RD session.

Thank you, 73,
--
Don Kuenz KB7RPU
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.
VanguardLH
2019-08-15 19:59:17 UTC
Permalink
Post by Don Kuenz, KB7RPU
Post by VanguardLH
Post by Don Kuenz, KB7RPU
Post by Don Kuenz, KB7RPU
My question is how to configure W10P and W16S to consistently display
"This task will be created with administrative privileges." when WinKey
R is entered?
Allow me to restate my question. Although lots of different ways exist
to run a task with administrative privileges, my goal is to arrange for
http://i.stack.imgur.com/32hqo.png
to popup whenever WinKey-R is pressed. Note how no additional steps are
necessary. Note the shield on the dialog.
And some of my suggestions addressed that. Did you try them?
Did your read my OP?
Let's try this a different way.
When the domain Administrator is logged into a W10P device with UAC
completely disabled, turned all the way down, WinKey-R is hit-and-miss.
On some devices it displays the shield, on others it doesn't.
Ctrl-Shift-Enter accomplishes nothing from the Run dialog.
The goal is to have WinKey-R simply show the shield, and avoid all Task
Manager, Start Menu, shortcut, cmd, etc. rigmarole.
Policy edits fail. Hacks fail.
Further research shows that things work for an Administrator logged on
at the console. The shield appears on W16S when WinKey-R is pressed and
Ctrl-Shift-Enter elevates the task from W10P's Run dialog.
It turns out that a Remote Desktop qualifier needs to be appended on my
How to configure W10P and W16S to consistently display a
shield along with "This task will be created with
administrative privileges." when WinKey-R is entered /from
a Remote Desktop session/?
1. mstsc /admin
2. Determine if there's a RD key combo analogous to Ctrl-Alt-End, which
is interpreted as Ctrl-Alt-Del on the remote end of a RD session.
Thank you, 73,
Nothing in your original post about remoting to the host where you want
to use its Run dialog. I haven't used RDP for a long time. The only
thing I remember about the /admin switch (was /console before) was that
I had to use it to kill sessions that users left open when they left
work at the end of the day. /admin does not confer any admin privileges
in the Windows account on the remote host, just admin functions within
the Terminal service running there. On the remote host, were you
logging into an admin-level account?

Nothing mentioned about logging in under a domain account (versus a
local account). Since you are logging into the remote host using a
domain account, and because a local account on the remote host works
okay, sure seems like the roaming profile or PDC is pushing a policy to
your remote host that alters the Run dialog.

When RDP'ing to the remote host:
1. Logging into remote host's local account works.
2. Logging into remote host's domain account doesn't work.
The difference is using a roaming profile and pushed policies for #2.

I take it enabling the ""User Account Control: Use Admin Approval Mode
for the built-in Administrator account" policy /on the remote host/
didn't help there for the remote host's Run dialog.

I suspect Ctrl+Shift+Enter can be used only locally, just like
Ctrl+Alt+Del. With RDP, you use Ctrl+Alt+End to effect Ctrl+Alt+Del on
the remote host. I think another way is to run OnScreen Keyboard
(osk.exe), press and hold Ctrl+Alt on your local host's keyboard, and
press the Del button on the OSK display. Since RDP hosts can be chained
(host A remotes to host B that remotes to host C), you'd run OSK on host
B to send Del to host C to do the Ctrl+Alt+Del on host C.

https://docs.microsoft.com/en-us/windows/win32/termserv/terminal-services-shortcut-keys

I don't see an RDP hotkey substitute for Ctrl+Shift+Enter (to effect
that key combo on the remote host), so maybe using OSK would work.

In RDP (on your local host), check the keyboard config: Local Resources
tab, Keyboard section. Check which setting is used. If it is set to
"Only when using the full screen" but you're windowed, then the Windows
key combos won't be sent to the remote host. See what happens if you
change to "On the remote computer".

https://www.nextofwindows.com/how-to-use-the-same-win-key-combinations-on-remote-desktop

"On the remote computer" has RDP hook into the keyboard at a lower level
(probably capturing the keyboard's scan codes). You can try the
different keyboard hooking to see if one of them lets you pass the
Ctrl+Shift+Enter key combo without having to use OSK. Of course, this
doesn't make it automatic that the Run dialog on the remote host will
run the command with admin privs. That seems to be a problem with the
domain login, roaming profile, and policy pushing on the remote host.
Don Kuenz, KB7RPU
2019-08-16 04:01:49 UTC
Permalink
In alt.comp.os.windows-10 VanguardLH <***@nguard.lh> wrote:

<snip>
Post by VanguardLH
Nothing in your original post about remoting to the host where you want
to use its Run dialog. I haven't used RDP for a long time. The only
thing I remember about the /admin switch (was /console before) was that
I had to use it to kill sessions that users left open when they left
work at the end of the day. /admin does not confer any admin privileges
in the Windows account on the remote host, just admin functions within
the Terminal service running there. On the remote host, were you
logging into an admin-level account?
Nothing mentioned about logging in under a domain account (versus a
local account). Since you are logging into the remote host using a
domain account, and because a local account on the remote host works
okay, sure seems like the roaming profile or PDC is pushing a policy to
your remote host that alters the Run dialog.
1. Logging into remote host's local account works.
2. Logging into remote host's domain account doesn't work.
The difference is using a roaming profile and pushed policies for #2.
I take it enabling the ""User Account Control: Use Admin Approval Mode
for the built-in Administrator account" policy /on the remote host/
didn't help there for the remote host's Run dialog.
I suspect Ctrl+Shift+Enter can be used only locally, just like
Ctrl+Alt+Del. With RDP, you use Ctrl+Alt+End to effect Ctrl+Alt+Del on
the remote host. I think another way is to run OnScreen Keyboard
(osk.exe), press and hold Ctrl+Alt on your local host's keyboard, and
press the Del button on the OSK display. Since RDP hosts can be chained
(host A remotes to host B that remotes to host C), you'd run OSK on host
B to send Del to host C to do the Ctrl+Alt+Del on host C.
https://docs.microsoft.com/en-us/windows/win32/termserv/terminal-services-shortcut-keys
I don't see an RDP hotkey substitute for Ctrl+Shift+Enter (to effect
that key combo on the remote host), so maybe using OSK would work.
In RDP (on your local host), check the keyboard config: Local Resources
tab, Keyboard section. Check which setting is used. If it is set to
"Only when using the full screen" but you're windowed, then the Windows
key combos won't be sent to the remote host. See what happens if you
change to "On the remote computer".
https://www.nextofwindows.com/how-to-use-the-same-win-key-combinations-on-remote-desktop
"On the remote computer" has RDP hook into the keyboard at a lower level
(probably capturing the keyboard's scan codes). You can try the
different keyboard hooking to see if one of them lets you pass the
Ctrl+Shift+Enter key combo without having to use OSK. Of course, this
doesn't make it automatic that the Run dialog on the remote host will
run the command with admin privs. That seems to be a problem with the
domain login, roaming profile, and policy pushing on the remote host.
My modus operandi is to use rdesktop from a couple of BSD workstations
to access my primary W16S host, which acts as a RD jump off point to
access various servers and workstations in the wild, so to speak. You're
right, the RD wrinkle should've been mentioned by me from the get-go.
Except that it's so automatic and ingrained that it didn't cross my mind
until today.
There is no RD hotkey substitute known to me at this point that
sends a WinKey-R to the far end of a Remote Desktop session. So be it,
a right mouse click over the start button reveals a menu with a Run
item. Good enough.
It turns out that Ctrl-Shift-Enter is sent to the far Remote
Desktop session and opens the UAC warning on the RD host as expected.

Here's how the various scenarios play out with mstsc /admin

Local Administrator on W10P shows shield
Local User on W10P doesn't show shield but elevates on Ctrl-Shift-Enter
Local/domain Administrator accounts on W12S and below show shield

This fills me with confidence that the other scenarios will also work.
The only fly in the ointment is that BSD rdesktop lacks an /admin flag.
It does use -0 as a /console flag and it knows RDP5. So, it probably can
be brought up to speed relatively easy.

Thank you, 73,
--
Don Kuenz KB7RPU
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.
Loading...