Hi John,
I see 2 errors in your line of code. You posted this line as your problem:
'link.SetIconLocation "C:\Windows\System32\SHELL32.dll", 13'
The 2 errors I see are that you left out the = sign and you have your
closing double-quote in the wrong place. The correct code should be:
link.SetIconLocation = "C:\Windows\System32\SHELL32.dll, 13"
Hope this helps,
CEF
John wrote:
> Hi
>
> I am using below code to create an icon on desktop;
>
> dstFolder = "C:\My App " & Mid(FormatDateTime(date,0),7,4) & "." &
> Mid(FormatDateTime(date,0),4,2) & "." & Mid(FormatDateTime(date,0),1,2)
> dstFolderFile = dstFolder & "\My App.exe"
>
> Set objShell = CreateObject("WScript.Shell")
> strFolder = objShell.SpecialFolders("AllUsersDesktop")
> Set link = objShell.CreateShortcut(strFolder & "\My App.lnk")
>
> link.Description = "My App"
> link.TargetPath = dstFolderFile
> link.WorkingDirectory = dstFolder
> link.SetIconLocation "C:\Windows\System32\SHELL32.dll", 13
> link.Save
>
> Problem is I am getting the belwo error on line 'link.SetIconLocation
> "C:\Windows\System32\SHELL32.dll", 13';
>
> Error: Object doesn't support this property or method:
> 'link.SetIconLocation'
>
> What is the problem and how can I fix it?
>
> Thanks
>
> Regards