Discussion:
What Windows "magic" invokes a command window as an Administrator window simply by using Control+Shift+Enter versus Enter?
(too old to reply)
Arlen George Holder
2019-08-14 23:57:01 UTC
Permalink
What Windows "magic" turns a command window into Administrator simply by
using "Control+Shift+Enter" versus "Enter"?

1. This opens an administrator command window:
Start > Run > cmd <Control+Shift+Enter>
2. This opens a user-level command window:
Start > Run > cmd <Enger>

How does that work?

What Windows "magic" enables that to work so beautifully elegantly?
--
See also Don Kuenz' detection of the elevated prompt window.
<https://alt.comp.os.windows-10.narkive.com/JQYSByUO/over-250-start-run-commands-please-improve-this-start-run-commands-list#post10>
JJ
2019-08-15 15:25:36 UTC
Permalink
Post by Arlen George Holder
What Windows "magic" turns a command window into Administrator simply by
using "Control+Shift+Enter" versus "Enter"?
Start > Run > cmd <Control+Shift+Enter>
Start > Run > cmd <Enger>
How does that work?
What Windows "magic" enables that to work so beautifully elegantly?
Nice magic, but there's no such magic in Windows 7. It only exist in Windows
10.
David E. Ross
2019-08-15 16:45:08 UTC
Permalink
Post by JJ
Post by Arlen George Holder
What Windows "magic" turns a command window into Administrator simply by
using "Control+Shift+Enter" versus "Enter"?
Start > Run > cmd <Control+Shift+Enter>
Start > Run > cmd <Enger>
How does that work?
What Windows "magic" enables that to work so beautifully elegantly?
Nice magic, but there's no such magic in Windows 7. It only exist in Windows
10.
Windows 7 SP1 Ultimate (x64)

When I hold Ctrl-Alt and select Run, the dialogue contains the following
under the input area:
"This task will be created with administrative privileges."
--
David E. Ross
<http://www.rossde.com/>

The headline reads:
"Trump urges 'common sense' gun measures, seeks NRA input"

Tell me, Mr. Fox, how many hens do you want in the hen house
we are asking you to guard?
JJ
2019-08-16 17:38:31 UTC
Permalink
Post by David E. Ross
Windows 7 SP1 Ultimate (x64)
When I hold Ctrl-Alt and select Run, the dialogue contains the following
"This task will be created with administrative privileges."
That's same as my system. Looks like it's only available after certain
hotfix, considering that I don't allow automatic updates (I only have some
installed manually), including for Win8, Win8.1, and Win10 in my VMs. All
those OSes in the VMs, only Win10 has such feature.
Arlen George Holder
2019-08-16 21:43:18 UTC
Permalink
Post by JJ
All
those OSes in the VMs, only Win10 has such feature.
Does anyone know what "magic" enables this wonderful feature?
I read that process doc but I still don't understand how it works.
JJ
2019-08-18 18:56:01 UTC
Permalink
Post by Arlen George Holder
Does anyone know what "magic" enables this wonderful feature?
I read that process doc but I still don't understand how it works.
It's just an added feature to use the shell's "RunAs" verb to open the given
command line, instead of the default "Open" verb.

Below VBScript demonstrate this.

set sa = createobject("shell.application")

'run Notepad normally
msgbox "About to run Notepad normally..."
sa.shellexecute "notepad"

'run Wordpad elevated
msgbox "About to run Wordpad Elevated..."
sa.shellexecute "wordpad", "", "", "runas"
John Taylor
2019-08-16 06:01:25 UTC
Permalink
Post by JJ
Post by Arlen George Holder
What Windows "magic" turns a command window into Administrator simply by
using "Control+Shift+Enter" versus "Enter"?
Start > Run > cmd <Control+Shift+Enter>
Start > Run > cmd <Enger>
How does that work?
What Windows "magic" enables that to work so beautifully elegantly?
Nice magic, but there's no such magic in Windows 7. It only exist in Windows
10.
Works for me in Windows 7 SP1 32-bit.
--
Don Kuenz, KB7RPU
2019-08-15 16:36:51 UTC
Permalink
Post by Arlen George Holder
What Windows "magic" turns a command window into Administrator simply by
using "Control+Shift+Enter" versus "Enter"?
Start > Run > cmd <Control+Shift+Enter>
Start > Run > cmd <Enger>
How does that work?
What Windows "magic" enables that to work so beautifully elegantly?
The process access rights are probably set to PROCESS_ALL_ACCESS when
the Run dialog calls CreateProcess.

https://docs.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights

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.
Arlen George Holder
2019-08-16 21:59:28 UTC
Permalink
Post by Don Kuenz, KB7RPU
The process access rights are probably set to PROCESS_ALL_ACCESS when
the Run dialog calls CreateProcess.
https://docs.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights
Hi Don Kuenz,

Maybe that reference explains the "magic", but I didn't get anything from
that which was useful in explaining HOW this "magic" works.

BTW, it works the same with both "cmd" and "powershell" for me anyway...
o Over 250 Start > Run commands (please improve this Start Run commands list)
<https://groups.google.com/forum/#!topic/microsoft.public.windowsxp.general/cc1lGn3ty0E>

From that useful reference, are these two sets of magical commands:

Start > Run > cmd <Enter> (opens a user-level command prompt)
Start > Run > cmd <Ctrl+Shift+Enter> (opens an admin-level command prompt)

Start > Run > powershell <Enter> (opens a user-level powershell)
Start > Run > powershell <Ctrl+Shift+Enter> (opens an admin-level powershell)

What is the Windows 'magic' that makes this work so beautifully?
Jonathan N. Little
2019-08-17 15:04:10 UTC
Permalink
Post by Arlen George Holder
Post by Don Kuenz, KB7RPU
The process access rights are probably set to PROCESS_ALL_ACCESS when
the Run dialog calls CreateProcess.
https://docs.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights
Hi Don Kuenz,
Maybe that reference explains the "magic", but I didn't get anything from
that which was useful in explaining HOW this "magic" works.
BTW, it works the same with both "cmd" and "powershell" for me anyway...
o Over 250 Start > Run commands (please improve this Start Run commands list)
<https://groups.google.com/forum/#!topic/microsoft.public.windowsxp.general/cc1lGn3ty0E>
Start > Run > cmd <Enter> (opens a user-level command prompt)
Start > Run > cmd <Ctrl+Shift+Enter> (opens an admin-level command prompt)
Start > Run > powershell <Enter> (opens a user-level powershell)
Start > Run > powershell <Ctrl+Shift+Enter> (opens an admin-level powershell)
What is the Windows 'magic' that makes this work so beautifully?
Special powder made from pulverized unicorn horns.

The 'magic' is simply the code some programmer put in while developing
the shell, same as WinKey+R opens the run dialog.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Arlen George Holder
2019-08-17 17:00:25 UTC
Permalink
Post by Jonathan N. Little
Special powder made from pulverized unicorn horns.
The 'magic' is simply the code some programmer put in while developing
the shell, same as WinKey+R opens the run dialog.
Hi Jonathan,

It's _embarrassing_ that none of us know how Windows works, least of all
me.

However, thanks for that advice but, um, er ... it doesn't really help to
say just give up on trying to learn how it works but I say that in a nice
way ...

Maybe it would help if we knew WHAT the "run" shortcut actually does next?

It's not an executable, for example.
And, even the "Run" shortcut isn't a "normal" shortcut (AFAICT).

It could be any one of these, for all we know:
o SCF (Windows Explorer Command)
o SHS (Shell Scrap Object)
o SHB (Document Shortcut)
o XNK (Exchange Folder Shortcut)
o LNK (File/Folder Shortcut)
o URL (Internet Shortcut)
o PIF (MS-DOS Program Shortcut)
o (many others) <https://ss64.com/nt/superhidden.html>

While I hate to surrender to a search, the ONLY way to pin the Run shortcut
to the taskbar, for example, is to first run a search to find it, and only
then can you pin that Run shortcut to the taskbar.

You can't just go to the location of the shortcut to pin it to the taskbar:
C:\tmp\special\Startup\System Tools\Run
Right clicking on that default "Run" shortcut doesn't tell us much either.
<Loading Image...>

I wasn't sure if the "Run" shortcut was a PIF or LNK (or other), so I
googled again how to show super hidden extensions (which I had done in the
past so I knew it could be done):
<https://techvedic-tech-support.blogspot.com/2013/09/how-to-show-file-extensions-of_20.html>
<https://www.askvg.com/tip-how-to-show-file-extensions-of-shortcuts-lnk-url-pif-in-windows-explorer/>
<https://h4hacking.wordpress.com/2016/04/07/how-to-show-super-hidden-file-extension-in-windows/>
etc.

I changed the name of these two registry entries:
FROM: [HKEY_CLASSES_ROOT\lnkfile\NeverShowExt]
TO: [HKEY_CLASSES_ROOT\lnkfile\NeverShowExt_]

FROM: [HKEY_CLASSES_ROOT\piffile\NeverShowExt]
TO: [HKEY_CLASSES_ROOT\piffile\NeverShowExt_]

And killed & restarted C:\Windows\explorer.exe and then found that "Run"
was "Run.lnk" (so it's a 'normal' shortcut, at least based on the naming.

But even so, I couldn't find out where this "Run.lnk" shortcut goes.
<Loading Image...>o

What does clicking on this "Run.lnk" shortcut actually "do" next?
Arlen George Holder
2019-08-17 17:10:57 UTC
Permalink
Post by Arlen George Holder
And killed & restarted C:\Windows\explorer.exe and then found that "Run"
was "Run.lnk" (so it's a 'normal' shortcut, at least based on the naming.
But even so, I couldn't find out where this "Run.lnk" shortcut goes.
<https://i.postimg.cc/JhwzLhY0/run02.jpg>
BTW, killing explorer.exe outside the task manager is easy:
C:\Windows\System32\taskkill.exe /im "explorer.exe" /t /f

But starting it back up _required_ the Task Manager:
Three-finger salute > Task Manager > File > Run new task > explorer.exe

It's interesting to note that the WinKey+R was disabled when "explorer.exe"
wasn't running.

Is there another way of bringing up the Run box when explorer.exe is dead?
T. Ment
2019-08-17 17:20:42 UTC
Permalink
Post by Arlen George Holder
It's _embarrassing_ that none of us know how Windows works
Proprietary closed source is like drugs. Just say no.
Don Kuenz, KB7RPU
2019-08-18 02:08:44 UTC
Permalink
Post by T. Ment
Post by Arlen George Holder
It's _embarrassing_ that none of us know how Windows works
"If you could see your way, sir, to confining your remarks to your own
peculiarities, you would find that you had an ample field for comment."
Post by T. Ment
Proprietary closed source is like drugs. Just say no.
As a BSD aficionado, Jonathan and your sympathies are certainly shared
by me. Be that as it may, it's far too late for the likes of us. The
Windows pandemic took hold decades ago.


Windows provides several ways to invoke its Run Dialog. Here's how the
Task Manager ultimately spawned a new process back in the day:

/* Try to exec 'szCommandLine'. */

/*changed order, since wPendINstance is a 32b HANDLE, and ret is WORD*/
if (!lpP)
lpP = TEXT("");

wsprintf(lpReserved, lpReservedFormat, 0, 0);

ret = (WORD)RealShellExecute(ghwndDialog, NULL, lpszPath, lpP,
lpDir, NULL, lpTitle, lpReserved,
(WORD)SW_SHOWNORMAL, &hProcess);

RealShellExecute is most likely a wrapper for the API CreateProcess
function shown below. (It's too much work for me to investigate this any
further for curiosity's sake.)
Inet searches indicate that some people seem to get some mileage out
of calling CreateProcess from within PowerShell. C's my native language
so don't ask me how to do this in PowerShell.

CreateProcess

The CreateProcess function creates a new process and its
primary thread. The new process runs the specified executable
file in the security context of the calling process.

If the calling process is impersonating another user, the new
process uses the token for the calling process, not the
impersonation token. To run the new process in the security
context of the user represented by the impersonation token,
use the CreateProcessAsUser or CreateProcessWithLogonW function.


BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);

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.
T. Ment
2019-08-18 06:48:21 UTC
Permalink
Post by Don Kuenz, KB7RPU
Post by T. Ment
Proprietary closed source is like drugs. Just say no.
As a BSD aficionado, Jonathan and your sympathies are certainly shared
by me. Be that as it may, it's far too late for the likes of us. The
Windows pandemic took hold decades ago.
Empires rise, empires fall. It's only a matter of time.
Jonathan N. Little
2019-08-17 22:30:39 UTC
Permalink
Post by Arlen George Holder
Hi Jonathan,
It's _embarrassing_ that none of us know how Windows works, least of all
me.
That's the nature of proprietary software. The alternative is open
source. This is why this is my only and last Winbox. All others I have a
Linux.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
J. P. Gilliver (John)
2019-08-18 05:49:50 UTC
Permalink
Post by Jonathan N. Little
Post by Arlen George Holder
Hi Jonathan,
It's _embarrassing_ that none of us know how Windows works, least of all
me.
While it's a truism that none of us knows how _all_ of Windows works,
there _are_ people who know how sections of it do - and taken as a
whole, we _do_. And by now, there are probably enough who are now
outside Microsoft that we - _as a whole_ - do know how it works, with
the exception of those bits that are to do with licencing/activation
etcetera.

I don't think it's _embarrassing_ as such, that no single individual
knows how all of it works: it's no different to any other complex
entity, such as a power station or even, these days, a car.
Post by Jonathan N. Little
That's the nature of proprietary software. The alternative is open
source. This is why this is my only and last Winbox. All others I have a
Linux.
I'm curious: given that Windows has now been around significantly longer
than the average or even extended life of a machine, as has Linux: if
"this" is your current machine, given your stated view of proprietary
software, why did you buy it when you did (alternatives would have been
available)?
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

The voices of Radio 4 continuity and newsreading have been keeping me right
for as long as I can remember. I can call on a million different information
sources, but it doesn't make sense unti I've heard it from Peter, Harriet,
Charlotte and the rest.- Eddie Mair in Radio Times 10-16 November 2012
Rabid Robot
2019-08-18 14:56:27 UTC
Permalink
Post by J. P. Gilliver (John)
Post by Jonathan N. Little
Post by Arlen George Holder
Hi Jonathan,
It's _embarrassing_ that none of us know how Windows works, least of all
me.
While it's a truism that none of us knows how _all_ of Windows works,
there _are_ people who know how sections of it do - and taken as a
whole, we _do_. And by now, there are probably enough who are now
outside Microsoft that we - _as a whole_ - do know how it works, with
the exception of those bits that are to do with licencing/activation
etcetera.
I don't think it's _embarrassing_ as such, that no single individual
knows how all of it works: it's no different to any other complex
entity, such as a power station or even, these days, a car.
I commend you for mentioning power stations in this context. I'm sure
that Anatoly Dyatlov, in Chernobyl, was quite knowledgeable about how
the power station worked back on the 26th of April, 1986.
Post by J. P. Gilliver (John)
Post by Jonathan N. Little
That's the nature of proprietary software. The alternative is open
source. This is why this is my only and last Winbox. All others I have a
Linux.
I'm curious: given that Windows has now been around significantly longer
than the average or even extended life of a machine, as has Linux: if
"this" is your current machine, given your stated view of proprietary
software, why did you buy it when you did (alternatives would have been
available)?
The problem with any machine purchased today is that open-source
software won't properly support it until three or four years from now.
Unless you purchase a machine which was explicitly built with hardware
that already has good driver support in Linux, it's not likely that your
experience will be any good. My laptop only recently got properly
supported by Ubuntu 19.04 and even then, the ACPI functionality is a
complete mess.
T. Ment
2019-08-18 15:13:51 UTC
Permalink
Post by Rabid Robot
The problem with any machine purchased today is that open-source
software won't properly support it until three or four years from now.
I wonder why people pay showroom price for brand new. Like cars, in a
few years they lose most of their value. Rich people aren't rich because
they spend a lot of money.
Jonathan N. Little
2019-08-18 16:21:54 UTC
Permalink
Post by Rabid Robot
The problem with any machine purchased today is that open-source
software won't properly support it until three or four years from now.
Unless you purchase a machine which was explicitly built with hardware
that already has good driver support in Linux, it's not likely that your
experience will be any good. My laptop only recently got properly
supported by Ubuntu 19.04 and even then, the ACPI functionality is a
complete mess.
Not been my experience. Been installing Ubuntu 16.04 on brand-spank'n
new systems with 8 generation Intel CPUs where the CPU predates the OS
release by 2 years and no problem. Haven't encountered a 9th gen yet.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jonathan N. Little
2019-08-18 16:13:35 UTC
Permalink
Post by J. P. Gilliver (John)
I'm curious: given that Windows has now been around significantly longer
than the average or even extended life of a machine, as has Linux: if
"this" is your current machine, given your stated view of proprietary
software, why did you buy it when you did (alternatives would have been
available)?
1) I build it, as nearly all my computers for over 20 years.
2) Started with Windows.
3) For business used CorelDraw back then. Only pro graphics software for
Windows. [could not do #1 with a Mac]
4) Been using Linux for servers @ 18 years ago
5) Been using Linux on all other systems for 12 years
6) Still need CorelDraw for business and no Linux port
7) Inkscape is good, but missing essential features that CD has, but do
use Inkscape to fix CD's bad SVG export.
8) When Windows becomes subscription only I'll have to find a way to
make Inkscape work for everything, or find some better alternative.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Arlen Holder
2020-08-04 21:49:02 UTC
Permalink
UPDATE:

Windows 10:
o Win+R > cmd {Enter} <== this opens a "user" command window
o Win+R > cmd {Ctrl+Shift+Enter} <== this opens an "admin" command window

And, not surprisingly...
o Win+R > wsl {Enter} <== pwd shows the cwd is /mnt/c/Users/{user}/
o Win+R > wsl {Ctrl+Shift+Enter} <== cwd is set to /mnt/c/WINDOWS/system32/

Yet... paradoxically...
o Win+R > wsl {Enter} <== a "whoami" shows this to be a "user" window
o Win+R > wsl {Ctrl+Shift+Enter} <== this is _still_ a "user" window

Go figure.
--
The reason this is important is when you're entering telnet commands, the
Linux telnet has options not necessarily in the Windows telnet, and, more
importantly, the shell in Linux also has nice options (e.g., bang bang).
Arlen Holder
2020-08-04 22:01:00 UTC
Permalink
Post by Arlen Holder
o Win+R > wsl {Enter} <== a "whoami" shows this to be a "user" window
o Win+R > wsl {Ctrl+Shift+Enter} <== this is _still_ a "user" window
Oooooops.

I forgot to mention that you won't have wsl unless you do this:
o Tutorial for setting up Ubuntu as a Windows Subsystem for Linux WSL in Windows 10
<https://groups.google.com/forum/#!topic/alt.comp.freeware/rOT8xBWo9dk>

Note: You won't have telnet in Windows either, unless you do this:
o Tutorial: How to enable the Telnet Client in Windows 10
<https://groups.google.com/forum/#!topic/alt.comp.freeware/pEhuvzzFBTU>

For example:
{me} Win+R > cmd {ctrl+shift+enter} <== optional, admin cmd window
{it} C:\WINDOWS\system32> <== this is the admin $p$g prompt apparently
{me} C:\WINDOWS\system32> telnet
{it} 'telnet' is not recognized as an internal or external command,
{it} operable program or batch file. <== I could "enable" it but screw that
{me} exit

Start over directly with Ubuntu running inside of Windows:
{me} Win+R > wsl <== to get into the Windows subsystem for Linux
{me} $ telnet nntp.aioe.org 119
{me} post
{it} 340 Ok, recommended message-ID <rgbtq6$blf$***@gioia.aioe.org>
{me} from: Arlen Holder <***@newmachine.com>
{me} newsgroups: comp.mobile.android
{me} subject: Re: Do you use FreedomPop in the USA? If so, what are the details?
{me} message-id: <rgbtq6$blf$***@gioia.aioe.org>
{me} references: <pv6ei5$bs0$***@news.mixmin.net>
{me} <blank line>
<control+v doesn't work, but sometimes control+q works here>
{me} .
{me} quit <== exit out of telnet
{me} exit <== exit out of wsl

This is what it looks like, in the flesh (with inevitable gotchas):
o <Loading Image...>
--
Two kinds of people frequent Usenet: those who add value & those who chat.
Loading...