Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program Shortcuts 1

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
I'm trying to create a simple install program for a project I'm compling. So far I've managed to copy the necessary files to the directory I want, but I want to put a shortcut on the desktop.

All my install does is copy files from A: to C:\<new directory>, which works fine for the few files there are. Execept for the shortcut I have made which I can't copy (I don't know the file extention for shortcuts)
So - does anyone know the file extention for shortcuts or have an idea on how to generate shortcuts and place them on the desktop??
<< Or even a more professional method of program instalation >>
 
That's great Thanx.

Sometimes it's easy to forget about the Microsoft Help !! I should have looked there first.

Steady ...
 
Here's an easy way to do it without using the API. It might actually be a bit more flexible because you can create a shortcut to almost anything, almost anywhere on a computer and set the shortcut icon at the same time.
[tt]
Private Sub CreateDesktopShortcut_Click()
MyDesktop$ = Environ$(&quot;windir&quot;) & &quot;\Desktop&quot;
ShortcutFile$ = MyDesktop$ & &quot;\&quot; & App.Title & &quot;.URL&quot;
If Dir(ShortcutFile$) <> &quot;&quot; Then
Kill ShortcutFile$
End If
MyApp$ = App.Path & &quot;\&quot; & App.EXEName & &quot;.exe&quot;
FF = FreeFile
Open ShortcutFile$ For Binary As #FF
P$ = &quot;[InternetShortcut]&quot; & vbCrLf
P$ = P$ & &quot;URL=&quot; & MyApp$ & vbCrLf
P$ = P$ & &quot;IconIndex = 0&quot; & vbCrLf
P$ = P$ & &quot;IconFile=&quot; & MyApp$ & vbCrLf
Put #FF, 1, P$
Close #FF
End Sub
[/tt]
I know... it's cheating. But it works.
VCA.gif

Alt255@Vorpalcom.Intranets.com​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top