2 Replies Latest reply on Jul 18, 2011 3:25 PM by Dataspike

    Quieried tasks for multiple packages

    Rookie

      Does anyone know how, or if possible to create a job that first queries a machine then runs a specific task or package?  Such as quiery machine for os type (32bit or 64bit) then run the appropriate installer.  What I want to do is have one task that automatically switches to the correct install package without any problems.  Any help or ideas would be much appreciated.

        • 1. Re: Quieried tasks for multiple packages
          zman Master

          Off the top of my head the easiest way is to do this through a custom vulnerability if the application itself does not have the logic to switch architecture types (X86 vs X64). If you don't want to use Patch, then you could run a simple script that identifies the correct Arch and run the exe.  Crude Autoit sample below:

           

          $OSArch = @OSArch
          Select
              Case $OSArch = "X86"
                  Runwait("Run the X86 EXE Here")
              Case $OSArch = "X64"
                  Runwait("Run the X64 EXE Here")
          EndSelect
          
          • 2. Re: Quieried tasks for multiple packages
            Specialist

            Here is a VB Script...

             

            Const HKEY_CLASSES_ROOT   = &H80000000
            Const HKEY_CURRENT_USER   = &H80000001
            Const HKEY_LOCAL_MACHINE  = &H80000002
            Const HKEY_USERS          = &H80000003


            strComputer = "."
            Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
            Set objProcessor = GetObject("winmgmts:\\.\root\cimv2:Win32_Processor='cpu0'")
            Set wshShell = CreateObject("WScript.Shell")

             

            'Example:   """" & "C:\Program Files\LANDesk\LDClient\LDISCN32.EXE" & """"

            strInvCmd = <32bit EXE Path>
            If (objProcessor.AddressWidth = "64") Then

               'Example:   """" & "C:\Program Files (x86)\LANDesk\LDClient\LDISCN32.EXE" & """"
               strInvCmd = <64bit EXE Path>
            End If

             

            ReturnCode = wshShell.Run(strInvCmd)