# CodeGuru Technical FAQs > CodeGuru Individual FAQs >  Windows SDK Application: How to get the current working directory?

## Andreas Masur

*Q:* How to get the current working directory?

*A:*



```
TCHAR szDirectory[MAX_PATH] = "";

if(!::GetCurrentDirectory(sizeof(szDirectory) - 1, szDirectory))
  // Error -> call '::GetLastError()'
```

----------

