Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stupid MS and their inconsistent icon definitions 2

Status
Not open for further replies.

JPJeffery

Technical User
May 26, 2006
600
GB
Hi

If you create a shortcut to an .msc file, such as (but not limited to) [tt]%windir%\system32\ipaddrmgmt.msc[/tt] the shortcut will have an appropriate icon. As I'm creating other shortcuts which run a script which then calls .msc file I wanted these shortcuts to have the same icon as the original .msc file.

So, I cobbled together this little script:
Code:
    Set vArgs = WScript.Arguments
    file = vArgs(0)
    Set Shell = CreateObject("WScript.Shell")
    Set link = Shell.CreateShortcut(file)
    wscript.echo file & ",""" & link.IconLocation & """"
    set link=nothing

This script works with other shortcuts but not the .msc shortcuts I've been trying to find the icons for.

Other examples of non-cooperative .msc file shortcuts are
[tt]diskmgmt.msc
secpol.msc
pkmgmt.msc
rsadmin.msc
rsop.msc
schmmgmt.msc[/tt]

Does anyone know why these shortcuts don't return the icon being used?

Or how I can find out which icon is being used (currently I'm trawling through HUNDREDS of icons using IconSearch which comes with Easy Icon Maker)?

JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
 
mmc.exe just gives me one icon (the MMC icon of a hammer in front of a Window)...it doesn't give me the other icons used by the .msc files.

JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
 
Ok, looking in the system32 directory, I think I see what you're trying to do. Some of the msc files have a different icon and you want the shortcut to use that icon. Have you tried just using those files for the icon path?
 
Yep. They don't contain icons at all.

JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
 
Open the msc files in Notepad and see where each one is pulling the icon from. For example, line 26 of diskmgmt.msc points to %systemroot%\system32\dmdskres.dll

hth.


"We must fall back upon the old axiom that when all other contingencies fail, whatever remains, however improbable, must be the truth." - Sherlock Holmes

 
Well would you look at that.

Thank you!

(Like I said though, stupid MS and their inconsistent icon definitions...)

:)

JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
 
That has worked for every single one...except %windir%\system32\ntmsmgr.msc (Removable Storage). Which is odd...

JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
 
There are some mmc's that don't declare an icon, ntmsmgr.msc is one of them. If you'll notice it is using the default icon from mmc.exe.


"We must fall back upon the old axiom that when all other contingencies fail, whatever remains, however improbable, must be the truth." - Sherlock Holmes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top