Overblog Tous les blogs Top blogs Technologie & Science Tous les blogs Technologie & Science
Editer l'article Suivre ce blog Administration + Créer mon blog
MENU

[vbscript] [Firefox] ouvrir une page en cache

Publié le par damcuvelier

'usage: cscript urlcache.vbs /url:<l'url qui est plantée" [option: /DEBUG pour avoir la ligne de commande (très utile pour récupérer plusieurs pages)]
Dim firefox,googlecache
dim wshshell

Set wshshell = WScript.CreateObject("WScript.Shell")

if WScript.Arguments.Named.Exists("url") then
cmd(chr(34) & "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" & chr(34) & " " & "http://webcache.googleusercontent.com/search?q=cache:"& url & "&cd=2&hl=fr&ct=clnk")
else
wscript.echo "il manque l'argument '/url:<l'url à récupérer>'"
end if

wscript.quit

function cmd(var)
if not WScript.Arguments.Named.Exists("debug") then
cmd = wshshell.run(var,0,true)
else
wscript.echo var
end if
End function


function url
if instr(lcase(WScript.Arguments.Named("url")),"http://")>0 then
url = split(WScript.Arguments.Named("url"),"http://")(1)
else
url = WScript.Arguments.Named("url")
end if
End function

Commenter cet article