' CONTROLLO AGGIORNAMENTI SOFTWARE - versione 0.2.1 - 18.04.2011 ' File di esempio realizzato da IlSoftware.it - www.ilsoftware.it ' --------------------------------------------------------------- messaggio="" const HKEY_LOCAL_MACHINE = &H80000002 strComputer="." Function leggiregistro (strKeyPath,strValueName) Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, sValue Set objReg=Nothing leggiregistro=sValue End Function Function leggipagina (url) Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "GET", url, 0 xmlhttp.send "" p=xmlhttp.responseText Set xmlhttp=Nothing leggipagina=p End Function chiave="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" valore="DisplayVersion" registry_keys=array(chiave+"Adobe Flash Player Activex",chiave+"Adobe Flash Player Plugin",chiave+"Pidgin",chiave+"FileZilla Client",chiave+"{AC76BA86-7AD7-1040-7B44-A94000000001}") urls=array("http://www.adobe.com/it/software/flash/about/","http://www.adobe.com/it/software/flash/about/","http://pidgin.im","http://filezilla-project.org/download.php?type=client","http://www.adobe.com/support/downloads/product.jsp?product=10&platform=Windows") pagina_intera=array(false,false,true,true,false) sinizio=array("Internet Explorer (e altri browser che supportano i controlli e i plug-in di Internet Explorer ActiveX)","Firefox, Mozilla, Netscape, Opera (e altri browser basati su plug-in)","","","Version 9.") sfine=array("","","","","") alerts=array("Flash Player per Internet Explorer non è aggiornato. ","Flash Player per Mozilla Firefox, Opera ed altri browser non è aggiornato. ","Pidgin non è aggiornato. ","FileZilla Client non è aggiornato. ","Adobe Reader non è aggiornato. ") testa_versione=array("","","","","9.") lungh_array=ubound(registry_keys) For i=0 to lungh_array versione=leggiregistro(registry_keys(i),valore) if versione then htmlpage=leggipagina(urls(i)) if pagina_intera(i)=false then inizio=instr(htmlpage,sinizio(i))+len(sinizio(i)) stringa=instr(inizio,htmlpage,sfine(i)) update=replace(mid(htmlpage,inizio,stringa-inizio),vbcrlf,"") update=replace(update,"","") update=replace(update,"","") update=replace(update,chr(10),"") update=testa_versione(i)+trim(update) if instr(update,versione)=0 then messaggio=messaggio+"- "+ alerts(i) +"Versione più recente: "+update+vbcrlf else update=htmlpage if instr(update,versione)=0 then messaggio=messaggio+"- "+ alerts(i) + vbcrlf end if end if Next if messaggio="" then WScript.Echo "Tutti i software controllati risultano aggiornati all'ultima versione" else WScript.Echo messaggio end if