mmc.exe (Microsoft Management Console) is the host executable that actually runs when you open diskmgmt.msc. So spawn mmc.exe by using CreateProcess(). For instance,
// Startup Info.
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
// Process Info.
PROCESS_INFORMATION pi;
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
CreateProcess( NULL,
_T("mmc.exe diskmgmt.msc"),
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi );
Well, If you just want to open the DiskManagementConsole, then ShellExecute() can do it more easily.
ShellExecute( 0, _T("open"), _T("diskmgmt.msc"), 0, 0, SW_SHOW );
Regards, Jijo.
_____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.