找到正在运行的进程EXE所在的目录

时间:2010-07-29 16:06:23

标签: c++ winapi

  

可能重复:
  How to get the application executable name in Windows (C++ Win32 or C++/CLI)?

我可以使用GetCurrentDirectory()找到进程运行的目录,但是找到executabke所在的目录呢?

2 个答案:

答案 0 :(得分:12)

答案 1 :(得分:-2)

在visual C ++中,我们使用

CString m_sAppFolder =  __targv[0] ;

返回类似“C:\ blah \ blah \ executable_name.exe”

的字符串
相关问题