Using DMS scripts, how can I modify the value of TEMP environmental variable in the registry?
search cancel

Using DMS scripts, how can I modify the value of TEMP environmental variable in the registry?

book

Article ID: 37663

calendar_today

Updated On:

Products

CA Automation Suite for Data Centers - Configuration Automation CA Client Automation - Asset Management CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Remote Control CA Client Automation - Asset Intelligence CA Client Automation - Desktop Migration Manager CA Client Automation - Patch Manager

Issue/Introduction

Introduction: 

The value of the TEMP variable on a machine can be modified using a DMS Script. The script can be packaged as a Software Delivery package and deployed to the machine on which the TEMP variable needs to be modified

Environment:  

CA Client Automation – All Versions

Instructions: 

Use the following script to update the TEMP Environment variable.

 


REM   DISCLAIMER:
REM   This job is provided "as is", for informational purposes only.
REM   In no event shall Computer Associates or its resellers be liable for any damages
REM   whatsoever (including, without limitation, damages for loss of business profits,
REM   business information, or other pecuniary loss) arising out of the use of or
REM   inability to use this job, even if Computer Associates has been advised of
REM   the possibility of such damages.
REM   This Script is an example.
REM   This Script modifies the Environmental Variable "TEMP" to C:\TEMP


Dim hKey, intval as integer
Dim StrVal as string

hKey=RegOpenKey(HKEY_LOCAL_MACHINE,"SYSTEM\CURRENTCONTROLSET\CONTROL\SESSION MANAGER\ENVIRONMENT")
RegQueryVariable(hKey,"TEMP",StrVal,intval)
' Old Value of the variable
' msgbox(Strval)
RegSetVariable(hkey,"TEMP","C:\TEMP")

RegCloseKey(hkey)

Note: For more information on the parameters, refer ITCM_DMSScriptingLanguage_Ref_ENU Guide

Environment

Release: UASIT.99000-12.9-Asset Intelligence
Component: