Could someone explain FILE > EXECUTE > working directory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    Could someone explain FILE > EXECUTE > working directory

    In the help files it says "the working directory to be used". Can someone officially explain the exact purpose of this option and in what scenarios it would apply? Is it just resetting the %SrcDir% to the new directory? Thanks...

    Corey Milner
    Creative Director, Indigo Rose Software
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

    #2
    Re: Could someone explain FILE > EXECUTE > working directory

    The working directory is what defines the starting point for any relative paths that a program uses. (It doesn't change %SrcDir% at all.)

    Each program typically has its working directory set to the same folder that the program executable was launched from.

    For example, if you run:

    C:\Program Files\Coreyvision\CoreyPaint.exe

    ...and the current working directory for the program is set to:

    C:\Program Files\Coreyvision\

    ...(which it typically is by default)...when CoreyPaint.exe access a file using a relative path, like:

    readme.txt

    ...it will actually look for it here:

    C:\Program Files\Coreyvision\readme.txt

    ...i.e., inside the current working directory. The relative path is relative to the working directory.

    If you were to open up a DOS prompt, and do this:

    cd C:\Windows

    ...you would be setting the current working directory to C:\Windows. The DOS prompt actually shows you this:

    C:\Windows>

    Now, if you ran CoreyPaint from there, by typing:

    "C:\Program Files\Coreyvision\CoreyPaint.exe"

    ...and then pressing Enter, the current working directory would still be C:\Windows.

    Some programs need the current working directory set in order for them to work properly, usually because the program expects its data files to be in the current working directory (it just accesses them with relative paths). And some programs expect you to set the current working directory to the folder where it will be loading files from and saving files to.

    In AutoPlay, you can generally either leave the field blank, or set it to the path where the program you're executing is located. If the program you're executing needs it set to something else, the program's documentation will usually tell you.
    --[[ Indigo Rose Software Developer ]]

    Comment

    Working...
    X