Difference between Current Directory and Working Directory in Windows

user2024398 picture user2024398 · Mar 11, 2013 · Viewed 8.5k times · Source

What is the difference between Current Directory and Working Directory in Windows? How can one change working Directory for applications like Notepad++ or Mozilla Firefox?

Answer

David Heffernan picture David Heffernan · Mar 11, 2013

Current directory and working directory are just two different names for the same thing. Each process maintains a single current directory.

The current directory is specified on startup as a parameter to whichever function is used to create the process, for example CreateProcess. How do you change the current directory for one of your applications? Well, it depends how you start it.

  • If you start it from a shortcut, change the properties of the shortcut to specify the current directory.
  • If you start from a command prompt, the current directory will be the current directory of the command prompt at the moment that you start it.
  • If you start by calling CreateProcess, the working current will be whatever you pass to CreateProcess in the lpCurrentDirectory parameter. If you pass NULL then the current directory of the parent process will be used.