VanguardLH <V...@nguard.LH> asked
> The icon shown in the Taskbar is taken from the image resources in the
> executable file for the program when you run it (a default one is
> specified, but there could be more than 1 image resource).
Hi Vanguard,
I've written tutorials on assigning icons so I'm aware of where _all_ the
Windows icons are kept (scattered about); but you just gave me a good idea.
Maybe perhaps I can _copy_ the cmd.exe executable and then I might be able
to call one cmd.exe for the user-level command and then call a copy of that
cmd.exe for the admin level command where I would have previously set each
to different icons... (dunno if that will work yet though - need to test)...
a. User level command window "Run > cmd [enter]" ==> black taskbar icon
b. Admin level command window "Run > [shift+alt+enter] ==> red taskbar icon
Maybe I can then set the admin level cmd.exe to show a red icon in the
taskbar while the normal user level cmd.exe would show the black icon.
I'll try that. Thanks for the idea.
> If you are
> asking how to make multiple running instances of the program have
> different images for their taskbar buttons, you can change the icon in
> the shortcut properties.
> Right-click on a shortcut -> Shortcut tab -> Change icon
As I said in the OP, I'm not using shortcuts because I generally don't make
shortcuts for a 3-character command (Run > cmd).
Having said that, I'm rather familiar with shortcuts to the scheduled tasks
(yes, I wrote a tutorial on that also) which bypass the UAC prompts.
I _could_ do this with shortcuts, but I was hoping for more elegance, which
usually takes knowledge of how Windows actually works to be successful.
> The default is to show you the image resources in the executable file
> specified for the shortcut to run. Some programs only have 1 image
> resource, and console-mode (DOS) programs often don't have any, so you
> pick one. cmd.exe has just 1 image resource, so opening multiple
> instances has the 1 image used in each taskbar button.
As I said in the OP, I'm not using a shortcut for a 3-character command,
but, of course, if that's the _only_ way to do it, I'll stoop that low. :)
> There are some other files bundled with Windows that provide image
> resources, like shell32.dll, and moricons.dll. Any file with an image
> resource (.exe, .dll) can be used to specify the icon source; however,
> if they for software you install, those image resources disappear when
> you uninstall that software.
Rest assured, I've located _every_ one as I wrote tutorials on this stuff.
> If you don't like any that are in Windows bundled files, or in
> executables you installed, you can also find .ico files online. I did
> that for a
weather.com icon since the icon resources in Windows didn't
> work. While I could try to rely on cached icons (favicon.ico) from a
> web site, periodially they seem to disappear, probably if you purge all
> locally cached data when exiting the web browser.
I've been making my own icons for years, where, nowadays, with Irfanview
being able to save a transparent bg ico file, it's trivial to create them.
> As I recall, a shortcut cannot point at a .bat file to run it. That's a
> text file that has to get fed into a command interpreter. The shortcut
> has to call cmd.exe when then runs the .bat file, as in:
> cmd.exe /c <path>\<batfile>
The restrictions between shortcuts to batch versus executable files is
something I habitually deal with on a case-by-case basis, and the ability to
string along "%comspec% -k" (or "%comspec% -c") commands is often used.
I have no problem stringing them together (using the "&&" syntax); but
that's not really what I'm asking here if that, in and of itself, doesn't
end up with the following:
1. When I run cmd as admin, I get a red icon in the taskbar.
2. When I run cmd as a user, I keep the normal black ion in the taskbar.
I'm almost never unsuccessful; I was just hoping someone else who knows
Windows better than I do had already solved this particular problem set.
Thanks. I'll let you know when I'm successful.