Punto informatico Network
Login Esegui login | Non sei registrato? Iscriviti ora (è gratuito!)
Username: Password:
  • Annuncio Pubblicitario

Errore VBScript

Il forum per tutti i developer. Leggere attentamente il regolamento di sezione prima di postare.

Errore VBScript

Messaggioda duomatic » sab dic 17, 2011 9:21 am

Salve a tutti oggi volevo utilizzare lo script per vedere se flash player è aggiornato ma mi restituisce un errore: Errore di run-time di Microsoft VBScript codice 800A000D, il testo dello script è questo:

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)</td>","Firefox, Mozilla, Netscape, Opera (e altri browser basati su plug-in)</td>","","","<th colspan=""3"" class=""data-sectionHead"">Version 9.")
sfine=array("</tr>","</tr>","","","</th>")
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,"<td>","")
update=replace(update,"</td>","")
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

Potete aiutarmi? Sistema operativo Windows 7 Home Premium
Avatar utente
duomatic
Aficionado
Aficionado
 
Messaggi: 57
Iscritto il: lun apr 26, 2004 5:41 pm
Località: Sardegna

Torna a Programmazione

Chi c’è in linea

Visitano il forum: Nessuno e 3 ospiti

Powered by phpBB © 2002, 2005, 2007, 2008 phpBB Group
Traduzione Italiana phpBB.it

megalab.it: testata telematica quotidiana registrata al Tribunale di Cosenza n. 22/09 del 13.08.2009, editore Master New Media S.r.l.; © Copyright 2008 Master New Media S.r.l. a socio unico - P.I. 02947530784. GRUPPO EDIZIONI MASTER Spa Tutti i diritti sono riservati. Per la pubblicità: Master Advertising