VB Code:
  1. Option Explicit
  2.  
  3. 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
  4.  
  5. Const SW_SHOWNORMAL = 1
  6.  
  7.  
  8. Private Sub Form_Load()
  9.  
  10. Dim lngFile As Long
  11. lngFile = FreeFile
  12.  
  13. 'delete the file if it's alive
  14. If Len(Dir("C:\temp.url")) Then Kill "C:\temp.url"
  15.  
  16. Open "C:\temp.url" For Append As lngFile
  17.     Print #lngFile, "[Default]"
  18.     Print #lngFile, "BASEURL=http://vbforums.com/showthread.php?s=&threadid=221262"
  19.     Print #lngFile, ""
  20.     Print #lngFile, "[InternetShortcut]"
  21.     Print #lngFile, "URL=http://vbforums.com/showthread.php?s=&threadid=221262"
  22. Close lngFile
  23.  
  24.    
  25. ShellExecute Me.hwnd, vbNullString, "C:\temp.url", vbNullString, "C:\", SW_SHOWNORMAL
  26.  
  27. Kill "C:\temp.url"
  28.    
  29. End Sub