Difference between Current Directory and Working Directory in Windows

我与影子孤独终老i 提交于 2019-12-23 07:48:47

问题


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 to CreateProcess in the lpCurrentDirectory parameter. If you pass NULL 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!