on 08-28-2008 1:58 PM
I am having trouble setting a new Registry value create a System Env Var
I need to set SAPLOGON_INI_FILE System env var for each client machine. However although I can the command
NWEngine.Shell.SetRegValue to adjust the value of an existing registry key
When I try SetRegKey to create a new key this is an invalid command.
Therefore How can I create a new registry key for
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]"SAPLOGON_INI_FILE"="C:
Program Files
SAP
FrontEnd
SAPgui
SAPLOGON.INI"
My code is as follows
' Add System Environment Variable for SAPLOGIN.INI'
If NwEngine.Shell.RegKeyExist("HKLM\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\SAPLOGON_INI_FILE") Then
NwEngine.Shell.DeleteRegKey ("HKLM\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\SAPLOGON_INI_FILE")
NwEngine.Shell.SetRegKey "HKLM\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\SAPLOGON_INI_FILE","REG_SZ","C:\Program Files\SAP\FrontEnd\sapgui\saplogon.ini"
End If
Is there any other way from this scripting to set this ENV var...
I was just doing the same thing. Although I realize this post is getting old.
I did it by using:
strRegEnv = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\SAPLOGON_INI_FILE"
NwEngine.Shell.SetRegValue strRegEnv, "REG_SZ", "(FILE LOCATION)"
I placed that at the "On end Install" and "On end Update" Level.
if the reg value is not already present, it will be created.
If the reg value does exist, it is replaced.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need to check whether system is 32 bit or 64 bit depending on which i Have to change the registry value as the key lies in differnt paths.
how can we check this?
Actually I cannot get the command in NWEngine.shell.
Will the following work?//
if %PROCESSOR_ARCHITECTURE%==x86 (
Then ----
) else (
------
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.