◄Summary► ◄Details► ◄Example► ◄Back► Argument path String expression representing the path to a new directory Description The ChDir procedure changes the current directory to a specified directory. ChDir functions work the same as the DOS command CHDIR or CD. The path argument may be any legal DOS path and may include the shorthand directory notation '.' and '..'. If the path includes a drive letter, ChDir changes the current drive to the drive specified in the path: ChDir( 'A:' ); If the directory does not exist, an I/O error occurs. To prevent a program from halting with a run-time error when an I/O error occurs, turn off I/O checking with {$I-} and check the return value of the IOResult function.