Advertisement
Guest User

milo

a guest
Oct 14th, 2009
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. Set WSHShell = CreateObject("WScript.Shell")
  2. Set sharedFolder = "\\10.1.2.0\sharefolder"
  3.  
  4. Dim fso,serverPath
  5. Set fso = CreateObject("Scripting.FileSystemObject")
  6. Dim tfolder, tname, tfile
  7. Const TemporaryFolder = 2
  8. Set tmpPath = fso.GetSpecialFolder(TemporaryFolder)
  9.  
  10.  
  11. 'Check Adobe Acrobat Reader
  12. AcrobatRegPath = "HKLM\SOFTWARE\Adobe\Acrobat Reader\9.0\Installer\VersionMax"
  13. If KeyExists(AcrobatRegPath) Then
  14. AcrobatRegValue = WSHShell.RegRead (AcrobatRegPath)
  15. If AcrobatRegValue<"589826" Then
  16. WScript.Echo "Need to install Adobe Acrobat Reader updates"
  17. serverPath = sharedFolder+"\acrobat\*.exe"
  18. fso.CopyFile serverPath,tmpPath,True
  19. tmpExec = tmpPath+"\msiexec.exe /qb /i AcroRead.msi"
  20. WSHShell.run tmpExec
  21. End If
  22. End If
  23.  
  24. 'Disable Javascript in Acrobat Reader
  25. AcrobatRegPath = "HKCU\SOFTWARE\Adobe\Adobe Acrobat\9.0\JSPrefs"
  26. If Not KeyExists(AcrobatRegPath) Then
  27. WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bEnableJS","0","REG_DWORD"
  28. WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bConsoleOpen","0","REG_DWORD"
  29. WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bEnableGlobalSecurity","1","REG_DWORD"
  30. WSHShell.regWrite "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs\bEnableMenuItems","0","REG_DWORD"
  31. End If
  32.  
  33. 'Check Adobe Flash
  34. FlashRegPath = "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{D27CDB6E-AE6D-11cf-96B8-444553540000}\Version"
  35. If KeyExists(FlashRegPath) Then
  36. FlashRegValue = WSHShell.RegRead (FlashRegPath)
  37. If FlashRegValue<"10.0.32.18" Then
  38. WScript.Echo "Need to install Adobe Flash updates"
  39. Const serverPath1 = sharedFolder+"\install_flash_player.exe"
  40. Const serverPath2 = sharedFolder+"\install_flash_player_ax.exe"
  41. fso.CopyFile serverPath1,tmpPath,True
  42. fso.CopyFile serverPath2,tmpPath,True
  43. tmpExec1 = tmpPath+"\install_flash_player.exe /S"
  44. tmpExec2 = tmpPath+"\install_flash_player_ax.exe /S"
  45. WSHShell.run tmpExec1
  46. WSHShell.run tmpExec2
  47. End If
  48. End If
  49.  
  50.  
  51. 'Check Java Runtime
  52. JavaRegPath = "HKLM\SOFTWARE\Sun Microsystems\JavaDB\CurrentVersion\Version"
  53. If KeyExists(JavaRegPath) Then
  54. JavaRegValue = WSHShell.RegRead (JavaRegPath)
  55. If JavaRegValue<"10.4.2.1" Then
  56. WScript.Echo "Need to install Java Runtime updates"
  57. serverPath = sharedFolder+"\jre-6u16-windows-i586-s.exe"
  58. fso.CopyFile serverPath,tmpPath,True
  59. tmpExec = tmpPath+"\jre-6u16-windows-i586-s.exe /s ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"
  60. WSHShell.run tmpExec
  61. End If
  62. End If
  63.  
  64.  
  65.  
  66. 'Check Quicktime
  67. QuicktimeRegPath = "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\Version"
  68. If KeyExists(QuicktimeRegPath) Then
  69. QuicktimeRegValue = WSHShell.RegRead (QuicktimeRegPath)
  70. If QuicktimeRegValue<"124026880" Then
  71. WScript.Echo "Need to install Quicktime updates"
  72. serverPath = sharedFolder+"\QuickTimeInstaller.exe"
  73. fso.CopyFile serverPath,tmpPath,True
  74. tmpExec = tmpPath+"\QuickTimeInstaller.exe /quiet"
  75. WSHShell.run tmpExec
  76. End If
  77. End If
  78.  
  79.  
  80.  
  81. Function KeyExists(key)
  82. Dim objShell
  83. On Error Resume Next
  84. Set objShell = CreateObject("WScript.Shell")
  85. objShell.RegRead (key)
  86. Set objShell = Nothing
  87. If Err = 0 Then KeyExists = True
  88. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement