简体   繁体   English

Windows中当前目录和工作目录之间的区别

[英]Difference between Current Directory and Working Directory in Windows

What is the difference between Current Directory and Working Directory in Windows? Windows中的当前目录和工作目录有什么区别? How can one change working Directory for applications like Notepad++ or Mozilla Firefox? 如何更改Notepad ++或Mozilla Firefox等应用程序的工作目录?

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 . 当前目录在启动时指定为用于创建进程的任何函数的参数,例如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. 如果从调用CreateProcess开始,则工作电流将是您在lpCurrentDirectory参数中传递给CreateProcesslpCurrentDirectory If you pass NULL then the current directory of the parent process will be used. 如果传递NULL则将使用父进程的当前目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM