Saturday, August 13, 2011

Relinking URLs

Relink.exe (wu, fs)
Relink [options] html_file [local paths to scan]

Converts hrefs to local urls
Html file backed up with .orig extension

Options:
-c list conversions
-u list unconverted urls
-n no conversion (-u -n lists all hrefs)
-d leave URIs decoded in the html source (converts %##)
This 3kb command line tool converts/fixes the url links in an html or hhc file to local links if the file exists locally. It treats anything that comes after href=, src= or value= as urls. It scans the xxx_files\ folder and the source folder of the html file. Additional paths to scan can be specified. e.g. relink abc\index.html img src will relink urls in index.html to use existing local files in the following folders: img\, src\, abc\index_html\, and abc\

It can only convert one file at a time but this is easily remedied using the recursive for command e.g. for /r %f in (*.html) do relink "%f". It is free, portable, uses very little memory (~110kb) while running, and does not modify any registry entries. Virustotal report 0/43. Download links: wu, fs

Friday, August 12, 2011

File repository

This is my temporary file repository. Currently it uses Wupload, Filesonic, and Megaupload.

HTML Tools
Relink.exe (wu, fs): Tool to convert urls in html files to link to existing local files

Saturday, August 6, 2011

Batch recursion

Here are 3 short scripts to demonstrate directory recursion
Script 1
@echo off
::demonstrates relative directory recursion
::does not detect hidden files

:main
for %%v in (*.*) do echo %%v
for /d %%v in (*.*) do call :sub "%%v"
goto :eof

:sub
for %%f in ("%~1\*.*") do echo %%f
for /d %%d in ("%~1\*.*") do call :sub "%%d"
goto :eof
Script 2
@echo off
::demonstrates directory recursion
::does detect hidden files but outputs fullpath
for /r %%v in (*.*) do echo %%v
Script 3
@echo off
::demonstrates directory recursion
::detects hidden files & outputs relative path

setlocal enabledelayedexpansion
for /r %%v in (*.*) do set n=%%v&echo !n:%CD%\=!