- //獲取以系統內置帳戶運行的進程的運行路徑
- 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,當以系統用戶啓動時,獲取不到正確的路徑