Build a html file from .URL files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
budhax
Posts: 59
Joined: 09 Oct 2006 12:25

Build a html file from .URL files

#1 Post by budhax » 16 Mar 2007 12:44

From those internet shortcut files (in the same a folder)

Google.url

Code: Select all

   [InternetShortcut]
   URL=http://www.google.com/


Yahoo.url

Code: Select all

   [InternetShortcut]
   URL=http://www.yahoo.com/


I would get a file link.html

Code: Select all

<a href="http://www.google.com/">Google</a>
<a href="http://www.yahoo.com/">Yahoo</a>


Do you have any idea ?

Thanks

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#2 Post by DosItHelp » 27 Mar 2007 23:05

budhax,

Crete a file named _url2linkhtml.cmd in the directory where you have the .url files, copy/paste the code below and run it:

Code: Select all

@echo off
(for /f "tokens=1,2,* delims=:=" %%a in ('findstr /i /b /c:"url=" "*.url"') do (
        echo.^<a href="%%c"^>%%~na^</a^>
))>link.html


DOS IT HELP? :wink:

budhax
Posts: 59
Joined: 09 Oct 2006 12:25

#3 Post by budhax » 31 Mar 2007 14:46

Sure, thanks a lot.

Post Reply