visual c++ - replacement of system() to run an .exe file which does not open cmd window in background -
i having visual studio 2005 , win 7 installed in system. in c++ downloading .exe local server using urldownloadtofile(). after downloading need run .exe file. able using system("path .exe file") opens cmd window in background. can tell me other method can use replace system() doesn't opens cmd window in background.
i had given try following methods
1. shellexecute(null,(lpcwstr) "explore",(lpcwstr) "c:/users/ay\\appdata/roaming/path-here/file.exe", null, null, sw_shownormal); 2. lptstr szcmdline = _tcsdup(text("c:\\users\\ay\\appdata\\roaming\\path-here\\file.exe -l -s")); createprocess(null, szcmdline,null,null,null,null,null,null,null,null);
but none of these command can start running .exe file. in advance.
once downloaded try following solution.
cstring exefilename; shellexecute(null, _t("open"), exefilename.getbuffer(), null, sexepresentindirectory, sw_shownormal); exefilename.releasebuffer();
i have tried, works fine.
for more please refer this.
Comments
Post a Comment