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:00 | #1

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

Inkogo 04/30/2022 02:03 | #2

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

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

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

Add comment
 
 

 

 
 
 
Posts of the actual month
Oktober 2022
MoTuWeThFrSaSu
 12
3456789
10111213141516
17181920212223
24252627282930
31 
 
© 2006-2022 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.