'Script to install CutePDF Writer Set WshShell = WScript.CreateObject("WScript.Shell") 'Get the Agent Installed directory from the Registry location details '==================================================================== Err.Clear checkOSArch = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE") 'Wscript.Echo checkOSArch if Err Then Err.Clear 'WScript.Echo "The OS Architecture is unable to find ,so it was assumed to be 32 bit" regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent" else if checkOSArch = "x86" Then 'Wscript.Echo "The OS Architecture is 32 bit" regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent" else 'Wscript.Echo "The OS Architecture is 64 bit" regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AdventNet\DesktopCentral\DCAgent" End IF End If agentDir = WshShell.RegRead(regkey & "\DCAgentInstallDir") 'WScript.Echo agentDir location = agentDir&"bin\7za.exe" 'WScript.Echo location 'Extraction of the CuteWriter.zip returnValue =WshShell.Run(Chr(34)& location &Chr(34)& " x CuteWriter.zip",0,TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else 'Extraction of the converter.exe returnValue =WshShell.Run(Chr(34)& location &Chr(34)& " x converter.exe",0,TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else 'Install converter.exe silently returnValue =WshShell.Run("Setup.exe",0,TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else 'Install CuteWriter.exe silently returnValue =WshShell.Run("CuteWriter.exe /verysilent",0,TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else Wscript.Quit returnValue end if end if end if end if Wscript.Quit returnValue