- Home
·
- Internet/HTML
·
- Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th
Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th
Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get the URL from a Windows Internet Shortcut
Rate Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th
(1(1 Vote))
'MyURL = GetURLFromFile("c:\windows\favorites\my shortcut.url")
'returns http:// or other address.
Private Function GetURLFromFile(Filename As Variant) As String
Dim Useless, URL As String
Open Filename For Input As #1
Input #1, Useless
Input #1, URL
If Useless = "[InternetShortcut]" Then
If Left$(URL, 4) = "URL=" Then
URL = Right$(URL, Len(URL) - 4)
ElseIf Left$(URL, 4) = "BASE" Then
URL = Right$(URL, Len(URL) - 8)
End If
Else
Input #1, Useless
Input #1, Useless
Input #1, URL
If Left$(URL, 4) = "URL=" Then
URL = Right$(URL, Len(URL) - 4)
ElseIf Left$(URL, 4) = "BASE" Then
URL = Right$(URL, Len(URL) - 8)
End If
End If
Close #1
GetURLFromFile = URL
End Function
Updated version of GetURLFromFile (This supports other formats, i.e. telnet://). Function to get th Comments
No comments yet — be the first to post one!
Post a Comment