FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Collected Web shortcuts to link index HTML





samz
A DOS script building a link's index HTML page base on .URL Web shortcuts:

U-LINK.CMD

Code:
::-------------------------------- Build a link's index HTML based on .URL files

::*UTILISATION: Collect and sort Web URL sortcut in subfolders. Launch This File
::*LIMITATIONS: URLs Shouldn't Contain DOS SPECIAL Characters

::*COMMAND LINE SAMPLE: U-LiNKS.CMd "URLsCollectedPathFolder\" "DestinationPath"

@ECHO OFF
CD /D "%~DP1"
@SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%a in ("%CD%") DO (SET CuFO=%%~na)
SET BoS=
IF EXIST "LiNKS'BO.CMd" (Call "LiNKS'BO.CMd" 1)


::----- Calcule La Taille Du Chemin Racine
FOR %%a in ("%CD%") DO (SET Racine=%%~Pna)
SET s=%Racine%
:LON
SET /a L+=1
SET s=%s:~0,-1%
IF "%s%"=="" GOTO:URL
GOTO:LON


:URL
SET /a L+=3
ECHO.-----------------------------------
ECHO.Nettoie Le Contenu Des Fichiers Url

FOR /f "Delims=" %%f in ('DIR /b/s "*.Url"') DO (
   ECHO.[InternetShortcut]> "%%~DPnf._Url"
   FINDSTR /b "URL=" "%%f">>"%%~DPnf._Url"
   DEL /F /Q "%%f"
   REN "%%~DPnf._Url" "%%~Nf.Url"
)


:HTM
ECHO.----------------------------
ECHO.Fichiers .Url vers liens HTM

SET P2=%~2
SET Fn=LiNKS
SET z=%~PD1%Fn%.hTM
IF /i NOT "%P2%"=="" (IF EXIST "%P2%\" (SET z=%P2%\%CuFO%.hTM))
TYPE NUL>"%z%"
(
ECHO.^<HTML^>^<HEAD^>
ECHO.^<TITLE^>%CuFO%^</TITLE^>
ECHO.^<STYLE type="text/css"^>
ECHO.HR{height:1Px;color:#666}
ECHO.BODY{font:12Px Verdana;cursor:default}
ECHO.H3{font: bold 13Px Arial; border-top:1Px solid #999999; margin:2Px 0Px}
ECHO.a{text-decoration:none;margin-right:8Px;white-space:nowrap;padding:1Px}
ECHO.a:hover {text-decoration:none;  border:1Px solid #FF3300;  padding:0Px}
ECHO.a:visited {color:#339900}
ECHO.a.b1{font-weight:bold}
ECHO.^</STYLE^>
ECHO.^</HEAD^>
ECHO.^<BODY^>
::--------------------------------------------------------------- Dossier racine
IF EXIST ".\*.url" (
 FOR /f "Tokens=1,2,* Delims=:=" %%a in ('FINDSTR /i /b /c:"URL=" "*.url"') DO (
   Call:FileN "%%c" "%%~na"
 )
)
::-------------------------------- Sous-Dossiers
FOR /f "Tokens=*" %%f in ('DIR /b/s/on/ad') DO (
IF EXIST "%%f\*.url" (
CD "%%f"
Call:HEADS "%%~f"
 FOR /f "Tokens=1,2,* Delims=:=" %%a in ('FINDSTR /i /b /c:"URL=" "*.url"') DO (
   Call:FileN "%%c" "%%~na"
 )
)
)
ECHO.^<HR/^>
ECHO.^</BODY^>^</HTML^>
)>>"%z%"
::COPY /Y "%z%" "%USERPROFILE%\DesKTOP\%CuFO%_.hTM"
IF /i NOT "%P2%"=="" (ECHO.*** Voir Fichier: %P2%\%CuFO%.hTM)

:FinN
ENDLOCAL&ECHO.&ECHO.END. BYE ......&PING -n 2 LocalHost>Nul&EXIT /b::___________



::*********************************************************************** H3 TAG
:HEADS
SET s=%~1
SET s=!s:~%L%!
ECHO.^<H3^>%s:\= \ %^</H3^>&GOTO:EOF

::*************************************************** Clean STRiNG / Build A TAG
:FileN
SET h=%~1
SET n=%~2
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:=%
SET n=%n:!=%
SET n=%n:.=%
SET n=%n:,=%
SET n=%n:#=%
SET n=%n:&=%
SET n=%n:$=%
SET n=%n:=%
SET n=%n:[=%
SET n=%n:]=%
SET n=%n:(=%
SET n=%n:)=%
SET n=%n:{=%
SET n=%n:}=%
SET ClassB1=
FOR %%b in (!BoS!) DO (IF /i "%%b"=="%n%" (SET ClassB1= class="b1"))
ECHO.   ^&bull;^<A href="%h%"!ClassB1!^>%n%^</A^>
GOTO:EOF

::______________________________________________________________________________
brokenadvice
What exactly does this do?
Marcuzzo
I didn't run the Batch file and I don't intend to but from the looks of the code it will create a HTML page displaying all the .lnk files in the current dir as a link
Jamestf347
This might come in handy, although it's kinda not in english : (.
Related topics
Can't access .TK domains
What Happens When You Visit the Web Site ?
Problem z index.html
Default index.html
none of my files show up BUT the index.html
What could be Default Address for index.html file?
Joomla! - Installation Tutorial
What are your Firefox extensions
index.html
index.html wont change
Can't Update Index.html
Not Showing The Right index.html
Is index.html different from public_html.html
how to change my index.html file with another file
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.