Cannot set Public desktop shortcut icon

Started by fastlane65, December 27, 2013, 11:31:42 AM

Previous topic - Next topic

fastlane65

I'm creating a desktop shortcut in the "all users" desktop folder and it does not show the default icon.  I added a shortcutextra to specifically point to the icon and it still does not show.  Right click on link properties, change icon, and icon is in the box to select and will show on desktop when applied.  Is this a restriction to the all users folder?  Compiled app is running with admin rights.  Target "application.exe" is compiled winbatch. 


alluserdir = shortcutdir(25,0,0)
shortcutmake(strcat(alluserdir,"\Application.lnk"), strcat(localpath,"application.exe"), "", "", @normal,0)
ShortcutExtra(strcat(alluserdir,"\Application.lnk"), "", strcat(localpath,"application.exe"),"",0,0)

Deana

Quote from: fastlane65 on December 27, 2013, 11:31:42 AM
I'm creating a desktop shortcut in the "all users" desktop folder and it does not show the default icon.  I added a shortcutextra to specifically point to the icon and it still does not show.  Right click on link properties, change icon, and icon is in the box to select and will show on desktop when applied.  Is this a restriction to the all users folder?  Compiled app is running with admin rights.  Target "application.exe" is compiled winbatch. 


alluserdir = shortcutdir(25,0,0)
shortcutmake(strcat(alluserdir,"\Application.lnk"),strcat(localpath,"application.exe"), "", "", @normal,0)
ShortcutExtra(strcat(alluserdir,"\Application.lnk"),"", strcat(localpath,"application.exe"),"",0,0)

The ShortcutExtra function expects the icon-file as the FOURTH parameter. However you seems to be specifying it as the THIRD.

ShortcutExtra(link-name, description, hotkey, icon-file, icon-index [, shortcut-type])

Try this instead:

Code (winbatch) Select
alluserdir = shortcutdir(25,0,0)
shortcutmake(strcat(alluserdir,"\Application.lnk"), strcat(localpath,"application.exe"), "", "", @normal,0)
ShortcutExtra(strcat(alluserdir,"\Application.lnk"), "", "",strcat(localpath,"application.exe"),0,0)
Deana F.
Technical Support
Wilson WindowWare Inc.