WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: fastlane65 on December 27, 2013, 11:31:42 AM

Title: Cannot set Public desktop shortcut icon
Post by: 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)
Title: Re: Cannot set Public desktop shortcut icon
Post by: Deana on December 27, 2013, 12:49:22 PM
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)