The following example stores the current directory to a variable, sets the default to the directory Visual FoxPro was started in, displays the new directory, returns the default to the original directory, and displays the original directory.
CLEAR
? 'Current directory: ', CURDIR( )
gcOldDir = SET('DEFAULT') + SYS(2003)
SET DEFAULT TO (HOME( ))
? 'Visual FoxPro directory: ', CURDIR( )
SET DEFAULT TO (gcOldDir)
? 'Current directory: ', CURDIR( )