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:
I use the following methodology:
Dim objShellClass As New IWshRuntimeLibrary.IWshShell_Class Dim objShortcut As IWshRuntimeLibrary.IWshShortcut
objShortcut = CType(objShellClass.CreateShortcut(strPathFile), IWshRuntimeLibrary.IWshShortcut)
.Arguments = strArguments
.Description = strName
.IconLocation = strIconLocation
.TargetPath = strTargetPath
.WindowStyle = IWshRuntimeLibrary.WshWindowStyle.WshNormalFocus
.WorkingDirectory = strWorkingDirectory
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?
Solved! Go to Solution.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.