SET DEFAULT Command

See Also

Specifies the default drive and directory.

Syntax

SET DEFAULT TO [cPath]

Arguments

cPath

Specifies one of the following:

Remarks

SET DEFAULT changes the default directory to the directory you specify.

Microsoft Visual FoxPro searches for a file in the default Visual FoxPro directory. The default directory is the one from which you start Visual FoxPro. However, you can specify a different default directory in your Visual FoxPro configuration file or in a startup program. If Visual FoxPro cannot find a file in the default directory, it then searches the Visual FoxPro path if one has been specified. Use SET PATH to specify the Visual FoxPro path.

If you create a file and don't specify where to place it, the file is placed in the default Visual FoxPro directory.

When you quit Visual FoxPro, you are returned to Windows. When you exit Windows, you are returned to the drive and directory that you started Windows from.

Tip   SYS(5) returns the default drive. SYS(2003) returns the default directory with no drive designator. SYS(5) + SYS(2003) returns the default drive and the directory.

You can change the default drive to drive A using either of the following commands:

SET DEFAULT TO A
SET DEFAULT TO A:

You can specify a specific directory:

SET DEFAULT TO A:\sales
SET DEFAULT TO C:\sales\data

You can specify a child directory. If the root directory on drive C is the default Visual FoxPro directory, issue the following command to change the default directory to C:\Sales:

SET DEFAULT TO sales

You can use MS-DOS shorthand notation. If the current directory is C:\Sales\Data, issue the following command to make the root directory the default directory:

SET DEFAULT TO \

You can also move the default directory one directory toward the root directory with the following command:

SET DEFAULT TO ..