Click here to Skip to main content
14,599,199 members
Rate this:
Please Sign up or sign in to vote.
See more:
i use msdev ..

i use wmi to create the subkey in registry..

i use void CreateKey()method.

But it create only the sub key..

i want to create the Dword value..

how to create that in any language but using wmi..

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Have a look at SetDWORDValue[^].
@BangIndia 13-Oct-11 6:11am
char chRegKeyName[WMI_MIN_BUFF];
strcpy(chRegKeyName,"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Policies\\Explorer\\test1");
CWbemMethod method(wmi, L"StdRegProv", L"StdRegProv", L"SetDWORDValue");
method.SetInParam(L"hDefKey", long(0x80000002) );
method.SetInParam(L"sSubKeyName", chRegKeyName);
// method.SetInParam(L"keyName","dharma");
method.SetInParam(L"sValueName", L"DffaysToKeep");

nCreateRetVal = method.GetReturnValue();

i have the coding like that only. but it not executed ..
i want to create the dword name is - test1.. how can i do

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100