Software Delivery Job: Start a Command in 64 bit Mode
search cancel

Software Delivery Job: Start a Command in 64 bit Mode

book

Article ID: 31305

calendar_today

Updated On:

Products

CA Client Automation - Asset Management CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Software Delivery

Issue/Introduction

By default SD Agent executes the jobs of type "Command file" with a cmd (Command interpreter) in 32 bit mode.
Sometimes it is necessary to execute the command file in 64 bit mode.
How to execute a "command file" in 64 bit mode?

Environment

Client Automation - All supported versions.

Resolution

Solution 1:

In the Configuration policy it is possible to specify the bit mode (32 or 64 bit) for Command interpreter :

DSM/Software Delivery/Agent/File Association: Command interpreter bit mode :

 

 

This parameter is "locally Managed" but it is possible to make it "Centrally Managed" and change the settings in a Configuration Policy applied on a group of machines.
 
In Locally Managed mode, it is possible to update the value directly on the agent machine with this command :
ccnfcmda -cmd SetParameterValue -ps itrm/usd/agent -pn cmdBinaryMode -v "64 bit"
 
 
The value could be checked with this command :
ccnfcmda -cmd GetParameterValue -ps itrm/usd/agent -pn cmdBinaryMode

 

 

Solution 2:

The disadvantage of Solution 1 is that all "command file" SD jobs will be executed in 64 bit mode.

If we need to execute the command interpreter in 64 bit for only one or few SD jobs we could let the cmdBinaryMode to default value (32 bit) and create a .cmd file containing following code :

 

@echo off
setlocal

SET PROCESS_64=0
SET CPU_64=0

IF DEFINED ProgramFiles(x86) (
  SET CPU_64=1
  IF NOT %PROCESSOR_ARCHITECTURE% == x86 SET PROCESS_64=1
 IF DEFINED PROCESSOR_ARCHITEW6432 SET PROCESS_64=0
)

SET CMD_PATH=%SystemRoot%\system32
IF %CPU_64% EQU 1 (
  IF %PROCESS_64% EQU 0 SET CMD_PATH=%SystemRoot%\sysnative
)

%CMD_PATH%\cmd /C script_to_launch_in_64_bit.cmd

endlocal

 

Replace script_to_launch_in_64_bit.cmd by the command to execute in 64 bit.

Add this script in the SD Package and use it for the SD Procedure.


Remarks: 

  • PROCESS_64 is a flag to indicate if the process is running in 32 or 64 bit mode. 

  • CPU_64 is a flag to indicate if the OS is 64 bit or 32 bit.

  • If the OS is 64 bit and process is 32 bit, cmd.exe is executed from path %SystemRoot%\sysnative (which is redirected to 64 bit system32 directory).
    In all other cases cmd.exe is executed from path %SystemRoot%\system32