icon dll file

R

Rob

I want to set up a desktop shortcut on everyones pc at
work. The Icon i want to use is in a dll file. How can I
extract the ico file from the moricons.dll?

Thanks

Rob
 
T

Torgeir Bakken \(MVP\)

Rob said:
I want to set up a desktop shortcut on everyones pc at
work. The Icon i want to use is in a dll file. How can I
extract the ico file from the moricons.dll?
Hi

Why do you want to extract the icon, when you can just use it
directly from the moricons.dll file?

If you do this from a script, you can point to what icon to
use by adding the index number (starts on 0) behind the dll
file name, like this:

moricons.dll,5


Below is a VBScript that creates two shortcuts named Lock
Workstation, one on the quick launch tray for the current user,
and one in the All Users Desktop folder. It uses the padlock
icon in Shell32.dll as shortcut icon.

Put the following in a .vbs file and double click on it:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

sWinSysDir = oShell.ExpandEnvironmentStrings("%SystemRoot%\System32")

' Create shortcut in the Quick Launch tray
sCurrUsrPath = oShell.ExpandEnvironmentStrings("%UserProfile%")
Set oShortCut = oShell.CreateShortcut(sCurrUsrPath _
& "\Application Data\Microsoft\Internet Explorer\" _
& "Quick Launch\Lock Workstation.lnk")

oShortCut.TargetPath = sWinSysDir & "\Rundll32.exe"
oShortCut.Arguments = "User32.dll,LockWorkStation"
oShortCut.IconLocation = sWinSysDir & "\Shell32.dll,47"
oShortCut.Save

' Create shortcut in the All Users Desktop folder
sAllUsersDesktopPath = oShell.SpecialFolders("AllUsersDesktop")
Set oShortCut = oShell.CreateShortcut( _
sAllUsersDesktopPath & "\Lock Workstation.lnk")

oShortCut.TargetPath = sWinSysDir & "\Rundll32.exe"
oShortCut.Arguments = "User32.dll,LockWorkStation"
oShortCut.IconLocation = sWinSysDir & "\Shell32.dll,47"
oShortCut.Save

MsgBox "Lock Workstation shortcuts are now created.", _
vbInformation + vbSystemModal, "Create shortcuts"

'--------------------8<----------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top