VB Code:
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Const SW_SHOWNORMAL = 1 Private Sub Form_Load() Dim lngFile As Long lngFile = FreeFile 'delete the file if it's alive If Len(Dir("C:\temp.url")) Then Kill "C:\temp.url" Open "C:\temp.url" For Append As lngFile Print #lngFile, "[Default]" Print #lngFile, "BASEURL=http://vbforums.com/showthread.php?s=&threadid=221262" Print #lngFile, "" Print #lngFile, "[InternetShortcut]" Print #lngFile, "URL=http://vbforums.com/showthread.php?s=&threadid=221262" Close lngFile ShellExecute Me.hwnd, vbNullString, "C:\temp.url", vbNullString, "C:\", SW_SHOWNORMAL Kill "C:\temp.url" End Sub




Reply With Quote