For example, if a program tries to open a file using relative directories (like e.g. "dir\\file.ext"
) then that relative directory is from the programs working directory. The working directory doesn't have to be the directory where the program is located, and the working directory can be changed from inside the program with e.g. the SetCurrentDirectory
function.
Another example: Lets say you are starting a program from a command prompt window, and you are in the directory C:\some\folder\
. The program is located in D:\other\folder\
. Since the current directory when you start the program is C:\some\folder\
, the programs working directory will be that as well.