Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 04, 2016, 02:19:12 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA:Internet Shortcut URL Extractor  (Read 2191 times)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 118
    • View Profile
    • Donate to Member
IDEA:Internet Shortcut URL Extractor
« on: October 23, 2013, 05:05:13 PM »
The basic concept of my idea is the ability to look at an Internet Shortcut and extract the URL to a txt file in the same folder using the same name

Ie

Internet shortcut
>
Internet Shortcut.txt containing the URL

The ability to process every subfolder in a selected folder and perform this funtion would reduce several hours work to minutes. An aditional option of ignoring if the appropriate txt files already exists would be great, as it would allow a fast re-run if required a a later date.

AHK is preferable as I can then learn better how it is done. :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,664
    • View Profile
    • Donate to Member
Re: IDEA:Internet Shortcut URL Extractor
« Reply #1 on: October 23, 2013, 05:51:28 PM »
When you say "Internet shortcut" are you talking about a .URL file?

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,664
    • View Profile
    • Donate to Member
Re: IDEA:Internet Shortcut URL Extractor
« Reply #2 on: October 23, 2013, 06:09:27 PM »
If you did mean .URL files, here you go (for use with AHK_L):

Code: Autohotkey [Select]
  1. ; Set file encoding.
  2. FileEncoding, UTF-8-RAW
  3.  
  4. ; Present folder selection dialog to user.
  5. FileSelectFolder, myFolder, , 2
  6.  
  7. If ! ( ErrorLevel ) ; If user did not press cancel.
  8. {
  9.     ; Iterate recursively over .URL files in chosen folder.
  10.     Loop, % myFolder . "\*.url", 0, 1
  11.     {
  12.         ; Clear var of stale data.
  13.         myURL := ""
  14.        
  15.         ; Read URL value of .URL file.
  16.         IniRead, myURL, % A_LoopFileFullPath, InternetShortcut, URL
  17.  
  18.         ; Crack path of .URL file.
  19.         SplitPath, A_LoopFileFullPath, , myOutDir, , myOutNameNoExt,
  20.  
  21.         ; Create new text file with URL data.
  22.         FileAppend, % myURL, % myOutDir . "\" . myOutNameNoExt . ".txt"
  23.     }
  24. }

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 118
    • View Profile
    • Donate to Member
Re: IDEA:Internet Shortcut URL Extractor
« Reply #3 on: October 25, 2013, 07:42:11 AM »
Hi Jody, many thanks will be a few days before I can test, rebuilding the PC :(