by Nepveux Software (4 Submissions)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 2nd November 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Function to get URL from Windows internet shortcut (.url)
Dim Useless, URL As String
Open Filename For Input As #1
Input #1, Useless
Input #1, URL
Close #1
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
GetURLFromFile = URL
End Function
'Example:
'MyURL = GetURLFromFile("c:\windows\favorites\shortcut.url")
'would return the http://www.whatever.com address