'Script to Install Desktop Central Agent '========================================== 'To install agent with the share path given as argument '=================================================================== On Error Resume Next Set WshShell = WScript.CreateObject("WScript.Shell") Set WshSysEnv = WshShell.Environment("Process") DrivePath = WshShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") checkOSArch = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE") if Err Then Err.Clear regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent\" else if checkOSArch = "x86" Then regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent\" else regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AdventNet\DesktopCentral\DCAgent\" End IF End If ' Get Location and arguments of the script currdir = WSCript.Arguments.Item(0) agentVersion = WshShell.RegRead(regkey&"DCAgentVersion") if Err Then Err.Clear if WSCript.Arguments.count = 2 then mstFile = WSCript.Arguments.Item(1) WshShell.Run "msiexec.exe /i """&currdir&""" TRANSFORMS="""&mstFile&""" ENABLESILENT=yes REBOOT=ReallySuppress /qn MSIRESTARTMANAGERCONTROL=Disable INSTALLSOURCE=GPO /lv "&DrivePath&"\dcagentInstaller.log",0,True Elseif WSCript.Arguments.count = 1 then WshShell.Run "msiexec.exe /i """&currdir&""" ENABLESILENT=yes REBOOT=ReallySuppress /qn MSIRESTARTMANAGERCONTROL=Disable /lv "&DrivePath&"\dcagentInstaller.log",0,True End if End If