- //获取以系统内置帐户运行的进程的运行路径
- wstring GetCurrentDirPath(void)
- {
- TCHAR wCurPath[MAX_PATH] = {0};
- GetModuleFileNameW(NULL,wCurPath,sizeof(wCurPath));
- wstring wTmp(wCurPath);
- wTmp = wTmp.substr(0,wTmp.rfind('\\'));
- return wTmp;
- }
- //注:最好不要用GetCurrentDirectory,当以系统用户启动时,获取不到正确的路径