This post is machine-translated. The original post in german language can be found here.

Read/modify registry

Following job demonstrates, how you can read/modify registry entries.

static void readWriteRegistry(Args _args)
{
    int                         regKey;
    container                   cRegValue;
    str                         regKeyValue;
    #WinApi

    // Read
    regKey = WinAPI::regOpenKey(#HKEY_CURRENT_USER, @"SoftwareMicrosoftDynamics6.0", #KEY_QUERY_VALUE);

    cRegValue = WinAPI::regGetValue(regKey, @"BuildVersion");
    if(conLen(cRegValue) > 0)
    {
        regKeyValue = conPeek(cRegValue, 1);
        info(strFmt("%1", regKeyValue));
    }

    WinAPI::regCloseKey(regKey);

    // Write
    regKey = WinAPI::regOpenKey(#HKEY_CURRENT_USER, @"SoftwareMicrosoftDynamics6.0", #KEY_QUERY_VALUE);
    cRegValue = WinAPI::regGetValue(regKey, @"BuildVersion");
    if(conLen(cRegValue) > 0)
    {
        regKey = WinAPI::regOpenKey(#HKEY_CURRENT_USER, @"SoftwareMicrosoftDynamics6.0", #KEY_WRITE);
        WinAPI::regSetValueEx(regKey, @"BuildVersion", 1, "Build: 6.3.164.0");
    }
    WinAPI::regCloseKey(regKey);
}
These post applies to following version:
Dynamics AX 2012

Inkogo 04/30/2022 02:04 | #1

It worked in AX2009 but only with '' separator in registry path:
@"Software\Microsoft\Dynamics\6.0"
;)

Add comment
 
 

 

 
 
 
Posts of the actual month
März 2024
MoTuWeThFrSaSu
 123
45678910
11121314151617
18192021222324
25262728293031
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.