Click here to Skip to main content
15,921,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

Have a look at SetDWORDValue[^].
Share this answer
@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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900