问题
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?
回答1:
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 toCreateProcess
in thelpCurrentDirectory
parameter. If you passNULL
then the current directory of the parent process will be used.
来源:https://stackoverflow.com/questions/15334097/difference-between-current-directory-and-working-directory-in-windows