WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: scotts on January 20, 2014, 01:43:13 PM

Title: Desktop Icon/shortcut verification
Post by: scotts on January 20, 2014, 01:43:13 PM
Hi,

how may I determine if a specific icon/shortcut exists on the current user desktop , and altimately alter it?

Thanks for nay nudge in the correct direction


Scott
Title: Re: Desktop Icon/shortcut verification
Post by: scotts on January 20, 2014, 02:24:10 PM
BTW - I know of ShortcutInfo and ShortCutDir, but I was looking for a way to determine if a shortcut is on the public desktop or the user desktop - etc. Almost like the FileItemize command..

Thanks
Title: Re: Desktop Icon/shortcut verification
Post by: Deana on January 21, 2014, 12:59:59 PM
I recommend using FileExist. keep in mind that the underling file contains the file extension .lnk.


Code (winbatch) Select
desktop = ShortCutDir("Desktop")              ; User
commondesktop = ShortCutDir("Common Desktop") ; Public
ret = FileExist( desktop : "Test.lnk" )
if ret
   Pause("Shortcut","Exists.")
else
   Pause("Shortcut","Does Not Exist.")
endif