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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File Command...

Status
Not open for further replies.

MeisoT

Technical User
Apr 25, 2004
43
US
I created a shortcut to an Access application on the desktop using a batch file with the following command:

Copy "C:\OldPath\AccessDB.mdb.lnk" "C:\Documents And Settings\UserName\Desktop"

How do I change the icon (the picture displayed) of the shortcut using the batch file.

I'm using Access 2000.

Thanks!
 
Make a shortcut to the batch file and change the icon of that shortcut. :) But seriously, that's the only way.
 
I think what MeisoT want's is to programattically change the icon of the shortcut being copied.

So, suppose C:\OldPath\AccessDB.mdb.lnk had it's icon changed from the standard MS Access Key icon to some user defined icon, say something in moricons.dll. Now the target machine may have moricons.dll in a different folder (say, winnt instead of windows) or mabye the Key icon was in D:\blah blah\msaccess.exe and the target has Access in c:\blah blah.

Anyway the short answer is that I don't know how to do that programatically. It's stored in the .lnk file, and the easiest way I know to open that is via cmd prompt (notepad.exe C:\OldPath\AccessDB.mdb.lnk) and you'll see som binary gibberish, which includes the double-spaced path as well as some pointer to the icon. Not sure if it's wise to mess with that, I'd think there's got to be an easier way though.
--JIm
 
I think you just want to put the icon image in the same folder as the shortcut, set the shortcut icon to what it will be once both files are moved to the user's desktop, and then move both files instead of just moving the shortcut.

Jeremy

---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top