#include "stdafx.h"
#include <Windows.h>
#include <string.h>
const int MAXPATHLEN=256;
int _tmain(int argc, _TCHAR* argv[])
{
  TCHAR * appPath=new TCHAR[MAXPATHLEN];
  memset(appPath,0,sizeof(TCHAR)*MAXPATHLEN);
  if ( !GetModuleFileName(NULL,appPath,MAXPATHLEN))
  {
    _tprintf(_T("GetModuleFileName failed. (%d)\n"),GetLastError());
  }
  else
  {
    (_tcsrchr(appPath, _T('\\')))[1] = 0;
    _stprintf(appPath,_T("%scmd.exe"),appPath);
    _tprintf(_T("%s"),appPath);
  }
  delete []appPath;
  appPath=NULL;
  return 0;
}

相关文章:

  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2021-06-10
  • 2021-07-28
  • 2021-05-04
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2022-02-15
  • 2021-08-01
相关资源
相似解决方案