Characters removed in PATH variable during uninstallation of agents
search cancel

Characters removed in PATH variable during uninstallation of agents

book

Article ID: 369424

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

On Windows server 2016 or 2019, some characters are removed in PATH environment variable during uninstallation of ITCM Agents.

  • On Windows Server 2016:
    The letter ‘d’ is removed.
    Example : ‘%SYSTEMROOT%\System32\WindowsPowerShell\v1.0’ was changed to ‘%SYSTEMROOT%\System32\WinowsPowerShell\v1.0’

  • On Windows Server 2019:
    The space characters is removed.
    Example ‘C:\Program Files\EMC Networker\nsr\bin’ was changed to ‘C:\ProgramFiles\EMC Networker\nsr\bin’

This problem is not seen in Windows 10, Windows 11 or Windows Server 2022

Environment

Client Automation 14.5

Cause

This problem occurs during uninstallation of Agents when CAWIN cleanup function is executed. If CAWIN is already uninstalled, the problem with missing character in PATH could occur.
 
Remark :
CAWIN is installed with Basic Agent.
When Basic Agent is installed following registry keys are created :
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ComputerAssociates\CAWIN\Client\R11AGT_BASE
 
If Basic Agent is uninstalled, the registry key is removed. And if another plugin is uninstalled (like SD, AM or RC), the path problem could occur.

Resolution

Make sure that Basic Agent is uninstalled at the end after all others plugins

OR (if Basic Agent is not present or was already removed) :

The workaround for both Windows 2016 and Windows 2019 :

1- Execute this powershell command before uninstallation of agents to add a temporary path "c:\testbegin d d d d d d testend;" at beginning of PATH variable :

$tmppath="c:\testbegin d d d d d d testend;"+[System.Environment]::GetEnvironmentVariable("Path","Machine")
[System.Environment]::SetEnvironmentVariable("Path",$tmppath,"Machine")

 

2- Execute this at the end of script to remove the temp path "c:\testbegin d d d d d d testend;"

$tmppath=[System.Environment]::GetEnvironmentVariable("Path","Machine") -replace 'c:\\testbegin.*testend;',''
[System.Environment]::SetEnvironmentVariable("Path",$tmppath,"Machine")

Additional Information

A correction in CAWIN cleanup procedure will be added in future release of Client Automation product (in MSI files located in iso).