I am working on a project to run chkDsk through ExecMethod on a particular drive.
Too passing the drive name. But it's not running.
This is the final line:
hRes = m_pService->ExecMethod(ClassName, MethodName, 0, NULL, pClassInstance, &pOutParams, NULL);
Here ClassName is Win32_Volume & MethodName is Chkdsk.
& drive is passed through
VARIANT varParam7;
varParam7.vt = VT_BSTR;
varParam7.bstrVal = SysAllocString(L"E:");
hRes = pClass->Put(L"DriveLetter", 0,&varParam7, 0);
hRes is HRESULT which is giving S_OK for every line except the final one where we use ExecMethod.
Please solve the issue & too tell me how to get the status of this Chkdsk WMI query.