My Visual Studio 2010 VB.NET program creates a shortcut to an ACAD.EXE file. I want to use the out-of-the-box AutoCAD icon image. The default path to the icon image is:
%SystemRoot%\Installer\{GUID}\ACA2013.ico
I use the following methodology:
Dim objShellClass As New IWshRuntimeLibrary.IWshShell_Class Dim objShortcut As IWshRuntimeLibrary.IWshShortcut
objShortcut = CType(objShellClass.CreateShortcut(strPathFile), IWshRuntimeLibrary.IWshShortcut)
With objShortcut
.Arguments = strArguments
.Description = strName
.IconLocation = strIconLocation
.TargetPath = strTargetPath
.WindowStyle = IWshRuntimeLibrary.WshWindowStyle.WshNormalFocus
.WorkingDirectory = strWorkingDirectory
.Save()
End With
Everything works fine except the shortcut image is blank. When I right-click on it and select properties, then Change Icon... it is pointing to the correct icon image. If I select OK and OK the icon image appears on the shortcut.
Why does the image NOT appear when the shortcut is initially created?
Thanks,
Randy
Solved! Go to Solution.