Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set WSHShell = CreateObject("WScript.Shell")
- Set sharedFolder = "\\10.1.2.0\sharefolder"
- Dim fso,serverPath
- Set fso = CreateObject("Scripting.FileSystemObject")
- Dim tfolder, tname, tfile
- Const TemporaryFolder = 2
- Set tmpPath = fso.GetSpecialFolder(TemporaryFolder)
- 'Check Adobe Acrobat Reader
- AcrobatRegPath = "HKLM\SOFTWARE\Adobe\Acrobat Reader\9.0\Installer\VersionMax"
- If KeyExists(AcrobatRegPath) Then
- AcrobatRegValue = WSHShell.RegRead (AcrobatRegPath)
- If AcrobatRegValue<"589826" Then
- WScript.Echo "Need to install Adobe Acrobat Reader updates"
- serverPath = sharedFolder+"\acrobat\*.exe"
- fso.CopyFile serverPath,tmpPath,True
- tmpExec = tmpPath+"\msiexec.exe /qb /i AcroRead.msi"
- WSHShell.run tmpExec
- End If
- End If
- 'Disable Javascript in Acrobat Reader
- AcrobatRegPath = "HKCU\SOFTWARE\Adobe\Adobe Acrobat\9.0\JSPrefs"
- If Not KeyExists(AcrobatRegPath) Then
- WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bEnableJS","0","REG_DWORD"
- WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bConsoleOpen","0","REG_DWORD"
- WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bEnableGlobalSecurity","1","REG_DWORD"
- WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bEnableMenuItems","0","REG_DWORD"
- End If
- 'Check Adobe Flash
- FlashRegPath = "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{D27CDB6E-AE6D-11cf-96B8-444553540000}\Version"
- If KeyExists(FlashRegPath) Then
- FlashRegValue = WSHShell.RegRead (FlashRegPath)
- If FlashRegValue<"10.0.32.18" Then
- WScript.Echo "Need to install Adobe Flash updates"
- Const serverPath1 = sharedFolder+"\install_flash_player.exe"
- Const serverPath2 = sharedFolder+"\install_flash_player_ax.exe"
- fso.CopyFile serverPath1,tmpPath,True
- fso.CopyFile serverPath2,tmpPath,True
- tmpExec1 = tmpPath+"\install_flash_player.exe /S"
- tmpExec2 = tmpPath+"\install_flash_player_ax.exe /S"
- WSHShell.run tmpExec1
- WSHShell.run tmpExec2
- End If
- End If
- 'Check Java Runtime
- JavaRegPath = "HKLM\SOFTWARE\Sun Microsystems\JavaDB\CurrentVersion\Version"
- If KeyExists(JavaRegPath) Then
- JavaRegValue = WSHShell.RegRead (JavaRegPath)
- If JavaRegValue<"10.4.2.1" Then
- WScript.Echo "Need to install Java Runtime updates"
- serverPath = sharedFolder+"\jre-6u16-windows-i586-s.exe"
- fso.CopyFile serverPath,tmpPath,True
- tmpExec = tmpPath+"\jre-6u16-windows-i586-s.exe /s ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"
- WSHShell.run tmpExec
- End If
- End If
- 'Check Quicktime
- QuicktimeRegPath = "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\Version"
- If KeyExists(QuicktimeRegPath) Then
- QuicktimeRegValue = WSHShell.RegRead (QuicktimeRegPath)
- If QuicktimeRegValue<"124026880" Then
- WScript.Echo "Need to install Quicktime updates"
- serverPath = sharedFolder+"\QuickTimeInstaller.exe"
- fso.CopyFile serverPath,tmpPath,True
- tmpExec = tmpPath+"\QuickTimeInstaller.exe /quiet"
- WSHShell.run tmpExec
- End If
- End If
- Function KeyExists(key)
- Dim objShell
- On Error Resume Next
- Set objShell = CreateObject("WScript.Shell")
- objShell.RegRead (key)
- Set objShell = Nothing
- If Err = 0 Then KeyExists = True
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement