Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Current Directory and Working Directory in Windows

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?

like image 311
user2024398 Avatar asked Mar 11 '13 08:03

user2024398


1 Answers

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.
like image 187
David Heffernan Avatar answered Oct 16 '22 12:10

David Heffernan