int nRes = (int)ShellExecute(NULL, _T("open"), openPath, NULL, NULL, SW_SHOWNORMAL); if(SE_ERR_NOASSOC == nRes) { CString strCmd; strCmd.Format(_T("RUNDLL32.EXE shell32, OpenAs_RunDLL %s"), openPath ); std::string dataCmd = CT2A( strCmd ); ::WinExec( dataCmd.c_str(), SW_SHOWNORMAL ); }