![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Error setting shortcut icon 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 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Error setting shortcut icon 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: Quote: > 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 |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Error setting shortcut icon Hi Thanks. I have tried link.SetIconLocation = "C:\Windows\System32\SHELL32.dll, 13" but still same error "Object doesn't support this property or method: 'link.SetIconLocation'". If I rem out this line then shortcut is created fine on the desktop. Thanks Regards "Charles E Finkenbiner" <CharlesEF_@_CEF-Inc.Com> wrote in message news:usy2cTtoJHA.3332@xxxxxx Quote: > 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: Quote: >> 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 |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Error setting shortcut icon On Mar 12, 8:52*am, "John" <i...@xxxxxx> wrote: Quote: > Hi > > Thanks. I have tried > > link.SetIconLocation = "C:\Windows\System32\SHELL32.dll, 13" > > but still same error "Object doesn't support this property or method: > 'link.SetIconLocation'". If I rem out this line then shortcut is created > fine on the desktop. > > Thanks > > Regards > > "Charles E Finkenbiner" <CharlesEF_@_CEF-Inc.Com> wrote in messagenews:usy2cTtoJHA.3332@xxxxxx > Quote: > > Hi John, Quote: > > I see 2 errors in your line of code. *You posted this line as your > > problem: Quote: > > 'link.SetIconLocation "C:\Windows\System32\SHELL32.dll", 13' Quote: > > 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: Quote: > > link.SetIconLocation = "C:\Windows\System32\SHELL32.dll, 13" Quote: > > Hope this helps, Quote: > > CEF Quote: > > John wrote: Quote: > >> Hi Quote: Quote: > >> I am using below code to create an icon on desktop; Quote: Quote: > >> * 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" Quote: Quote: > >> * Set objShell = CreateObject("WScript.Shell") > >> * strFolder = objShell.SpecialFolders("AllUsersDesktop") > >> * Set link = objShell.CreateShortcut(strFolder & "\My App.lnk") Quote: Quote: > >> * link.Description = "My App" > >> * link.TargetPath = dstFolderFile > >> * link.WorkingDirectory = dstFolder > >> * link.SetIconLocation "C:\Windows\System32\SHELL32.dll", 13 > >> * link.Save Quote: Quote: > >> Problem is I am getting the belwo error on line 'link.SetIconLocation > >> "C:\Windows\System32\SHELL32.dll", 13'; Quote: Quote: > >> Error: Object doesn't support this property or method: > >> 'link.SetIconLocation' Quote: Quote: > >> What is the problem and how can I fix it? Quote: Quote: > >> Thanks Quote: Quote: > >> Regards link.IconLocation = "C:\Windows\System32\SHELL32.dll, 13" See WSH 5.6 documentation download (URL all one line) http://www.microsoft.com/downloads/d...displaylang=en Tom Lavedas *********** http://there.is.no.more/tglbatch/ |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Error setting shortcut icon Hi John, Tom's post below is correct. I missed the 3rd error in your code. Tom caught it. Hope this helps, CEF John wrote: Quote: > Hi > > Thanks. I have tried > > link.SetIconLocation = "C:\Windows\System32\SHELL32.dll, 13" > > but still same error "Object doesn't support this property or method: > 'link.SetIconLocation'". If I rem out this line then shortcut is created > fine on the desktop. > > Thanks > > Regards > > "Charles E Finkenbiner" <CharlesEF_@_CEF-Inc.Com> wrote in message > news:usy2cTtoJHA.3332@xxxxxx Quote: >> 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: Quote: >>> 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 > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| security icon over program icon/shortcut | Vista security | |||
| Shortcut Icon | Vista General | |||
| Shortcut Icon | General Discussion | |||
| File Icon Removal (Not a Shortcut Icon) | Vista General | |||
| Shortcut icon error | Vista installation & setup | |||