Creating Internet Shortcuts
A great way of advertising your site is to offer a link from the desktop or Start Menu to your site. To do this, you create a URL file. When this file is double-clicked, it opens up the default browser with the Web Site stored in the file. The structure of the file is as follows.
URL File Structure
A URL file has the extension .URL, and contains the following text:
[InternetShortcut] URL=http://www.websiteaddress.com
A Internet Shortcut file that points towards VB-World would have the format:
[InternetShortcut] URL=http://www.vb-world.net
Code
The following code creates a Internet Shortcut on the desktop.
'declare variables Dim StrURLFile As String Dim StrURLTarget As String Dim FileNum As Integer 'initialise Variables StrURLFile = "C:WindowsDesktopVB-World.url" StrURLTarget = "http://www.vb-world.net" FileNum = FreeFile 'Write the Internet Shortcut file Open StrURLFile For Output As FileNum Print #FileNum, "[InternetShortcut]" Print #FileNum, "URL=" & StrURLTarget Close FileNum