On 8 Jul 2018 19:17:22 GMT, Arlen Holder wrote:
> On 8 Jul 2018 07:14:53 GMT, Kerr-Mudd,John wrote:
>
>> Your request boils down to changing the colo(u)r of a cmd prompt window
>> launched from a context menu item off a folder.
>
> Thanks for your kind help - which solved the color problem after a few
> empirical false starts.
>
> The good news is that this new solution that you just helped me arrive at
> below is now archived in the following newsgroups, which will benefit
> everyone in them, now and in the future.
>
http://tinyurl.com/alt-msdos-batch
>
http://tinyurl.com/alt-comp-os-windows-10
>
http://tinyurl.com/microsoft-public-windowsxp-gen (30-char limit)
>
>> for best results stick "color 56" in the launched batch. colon dash right
>> bracket.
>
> Thanks for hazarding advice, as I know it's always risky to try to help a
> noob as the risk is that the technical morass is too deep for either of us
> to get out of (e.g., ask me how many times I've bricked a system testing
> things out like disabling cortana or disabling Windows updates!). :)
>
> I admit I don't understand the location you're referring to as "launched
> batch. colon dash" but the *only* place I surmise we "can" add the color is
> in these two lines of the previously posted INF file:
> HKCR,Directory\Shell\runas\command,,,"%11%\cmd.exe /k cd /d ""%1"""
> HKCR,Drive\Shell\runas\command,,,"%11%\cmd.exe /k cd /d ""%1"""
>
> Testing on the command line the "color 56" syntax, I find this hint:
> C:\> %comspec% /? | findstr color
> /T:fg Sets the foreground/background colors (see COLOR /? for more info)
>
> Where following through on the suggestion provides this background info:
> C:\> color /?
> Color attributes are specified by TWO hex digits -- the first
> corresponds to the background; the second the foreground. Each digit
> can be any of the following values:
> 0 = Black 8 = Gray
> 1 = Blue 9 = Light Blue
> 2 = Green A = Light Green
> 3 = Aqua B = Light Aqua
> 4 = Red C = Light Red
> 5 = Purple D = Light Purple
> 6 = Yellow E = Light Yellow
> 7 = White F = Bright White
>
> I think that means we want "47" for a red background with white fonts
> (which a "color 47" command confirms in a default black command window).
> C:\> color 47
> C:\> color
> (The first command changed the colors, the second reversed that.)
>
> I admit I don't understand the syntax of the two INF commands above, but I
> can sort of kind of maybe see where I'd put the "color" option as:
> C:\> cmd.exe -T:47
> But that doesn't work in a command window like "color 47" did in that same
> window, so I'll just test it experimentally (which always gets me in
> trouble).
>
> This seems intuitive to test (although that concept of intuitive syntax has
> bitten me greatly in the past):
> HKCR,Directory\Shell\runas\command,,,"%11%\cmd.exe /T:47 /k cd /d ""%1"""
> HKCR,Drive\Shell\runas\command,,,"%11%\cmd.exe /k cd /d /T:47 ""%1"""
>
> I changed "CmdHereAsAdmin.inf" to "CmdHereAsAdminRed.inf" and right clicked
> on it and selected "install" to test it out...
>
> Well - that gave an error ... but the error was unrelated, which was:
> Files Needed. The file "CmdHereAsAdmin.INF" on Open command window
> here (admin) is needed. Type the path where the file is located, and
> then click OK.
>
> I decided to just change the name back to "CmdHereAsAdmin.INF" which was
> easier than changing all the references inside the file itself.
>
> Voila!
>
> Now when I right click on a folder, I get the same context menu entry that
> says:
> "Open command window here (admin)"
> but which now opens that command window as a red background with a white
> font (the purpose being so that we can tell it's not a "normal" command
> window but a "red" admin command window).
>
> Thank you for hazarding helpful advice, where I much appreciate the hint to
> use the "color 56" option, and where the result will help anyone who wishes
> to add an "Open a red command window here as admin" context menu entry on
> any Windows version, from Win95 upwards (I would assume).
>
> What's left is modifying the INF so that it works on more than just
> folders, but which also works inside a folder when no folder is selected,
> which is how the normal "Open a black command window here as the user"
> works.
>
> For example, after loading both the "user cmd" REG file and after loading
> the "admin cmd" INF file, neither the "user cmd" or "admin cmd" context
> menu entry shows up when I right click in white space on "My PC".
> <
http://img4.imagetitan.com/img.php?image=18_showuphere01.jpg>
>
> But when I right click on "C:", the "user cmd" entry shows up,
> while the "admin cmd" entry remains dormant:
> <
http://img4.imagetitan.com/img.php?image=18_showuphere02.jpg>
>
> Similarly, when I right click in white space inside any one folder,
> the "user cmd" shows up but the "admin command" remains hidden:
> <
http://img4.imagetitan.com/img.php?image=18_showuphere03.jpg>
>
> Yet, when I right click on a folder, both finally show up:
> <
http://img4.imagetitan.com/img.php?image=18_showuphere04.jpg>
>
> And, neither shows up when I right click on a file:
> <
http://img4.imagetitan.com/img.php?image=18_showuphere05.jpg>
>
> My next task, which help is always requested, is to figure out how to give
> myself, and all the users here, the new ability to open the red admin
> command prompt in the same places where we already open the black user
> command prompt - since - to my knowledge - nobody on the planet has posted
> this capability yet (AFAIK).
On 8 Jul 2018 19:17:22 GMT, Arlen Holder wrote:
> I admit I don't understand the syntax of the two INF commands above, but I
> can sort of kind of maybe see where I'd put the "color" option as:
> C:\> cmd.exe -T:47
> But that doesn't work in a command window like "color 47" did in that same
> window, so I'll just test it experimentally (which always gets me in
> trouble).
I belatedly realized my first test on the command syntax was wrong in that
the syntax is not "cmd.exe -T:47" but "cmd.exe /T:47" so I'm correcting
this for the record.
This shows that the "cmd /T:47" & "cmd /T:56" syntax works fine
inside a command window.
<
http://img4.imagetitan.com/img.php?image=18_cmdwindow03.jpg>
Now the goal is to figure out what magic enables the user command
window context menu to open no matter where the mouse is, but
we can't get the admin command window menu to show up unless
we select a folder:
<
http://img4.imagetitan.com/img.php?image=18_cmdwindow04.jpg>