Page 1 of 1

Build a html file from .URL files

Posted: 16 Mar 2007 12:44
by budhax
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

Posted: 27 Mar 2007 23:05
by DosItHelp
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:

Posted: 31 Mar 2007 14:46
by budhax
Sure, thanks a lot.