If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Efficient Windows Admin command prompt of any color in any desired location
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 |
Ads |
#2
|
|||
|
|||
Efficient Windows Admin command prompt of any color in any desired location
On Mon, 09 Jul 2018 00:37:49 GMT, Arlen Holder
wrote: "cmd /T:56" clearly (or maybe not!) this was a joke. It's a horrid colo(u)r scheme. cmd.exe /T:02 green screen retro is the only one for me. -- Bah, and indeed, Humbug. |
#3
|
|||
|
|||
Efficient Windows Admin command prompt of any color in any desired location
On 9 Jul 2018 06:39:30 GMT, Kerr-Mudd,John wrote:
clearly (or maybe not!) this was a joke. It's a horrid colo(u)r scheme. cmd.exe /T:02 green screen retro is the only one for me. Hi John Kerr-Mudd, I don't get jokes ... I've never gotten them. I'm all facts, and only facts. So I appreciate that explanation. Here, by the way, are the three color schemes side by side... http://img4.imagetitan.com/img.php?image=18_cmdwindow05.jpg The actual color scheme didn't matter anyway as what was important was the fact that an admin window should stand apart on sight, and that the color turned out to be trivial once I realized that you were telling me that the command itself could specify the color: https://www.tenforums.com/tutorials/94004-customize-command-prompt-colors-windows.html I've moved on to solving the other part of the problem, which is that the user-level "Open command window here (user)" REG file causes the menu to show up under more circumstances than does the "Open command window here (admin)" INF result. https://www.tenforums.com/tutorials/72024-open-command-window-here-add-windows-10-a.html By studying the registry after running both the REG & INF, I'm starting to see how to add the context menu under various right-click circumstances. To be clear, I have never dissected such things before, but I'm beginning to figure out a solution empirically, where, when I'm done, everyone will have both commands working anywhere they click: * Open command window here (users) = works on both white space & folders * Open command window here (admin) = only works on folders at the moment If you don't hear back from me, it means I haven't found the solution yet. If you hear back from me, that means everyone will have a working solution by me that they can just cut and paste and it will work for them. |
#4
|
|||
|
|||
Efficient Windows Admin command prompt of any color in any desired location
In message ,
"Kerr-Mudd,John" writes: On Mon, 09 Jul 2018 00:37:49 GMT, Arlen Holder wrote: "cmd /T:56" clearly (or maybe not!) this was a joke. It's a horrid colo(u)r scheme. Indeed! cmd.exe /T:02 green screen retro is the only one for me. Being a Hitchhiker's Guide fan, I tried 00 - but it has a trap for that )-:. (The two digits - hex - are background/foreground; "Color /?" will list what's what. And you can type color rather than restarting cmd if you want to play: "color f0" for those that remember the ZX80/81 [Sinclair, Timex I think in USA].) -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf in the kingdom of the bland, the one idea is king. - Rory Bremner (on politics), RT 2015/1/31-2/6 |
Thread Tools | |
Display Modes | |
|
|