This in the registry is simply not necessary in the place you expect (it is in SAM). From what I can say, all the settings are enabling or disabling the guest account, so just enable or disable the account.
You didn’t say which programming language you are using, so here is a simple C code to enable the account, if you need something else, I’m sure there are a lot with google.
#include <LM.h> #pragma comment(lib, "Netapi32.lib") BOOL EnableUser(LPCWSTR lpUserName, BOOL bEnable) { BOOL bRet = FALSE; DWORD dwLevel = 1008; LPUSER_INFO_1 ui1; USER_INFO_1008 ui1008; NET_API_STATUS nStatus; nStatus = NetUserGetInfo(NULL, lpUserName, 1, (LPBYTE*)&ui1); if(nStatus == NERR_Success) { ui1008.usri1008_flags = ui1->usri1_flags; if(bEnable) { ui1008.usri1008_flags &= ~UF_ACCOUNTDISABLE; } else { ui1008.usri1008_flags |= UF_ACCOUNTDISABLE; } nStatus = NetUserSetInfo(NULL, lpUserName, dwLevel, (LPBYTE)&ui1008, NULL); NetApiBufferFree(ui1); if(nStatus == NERR_Success) { bRet = TRUE; } } return bRet; }
source share