Home > Language Reference > System Functions > ChDir

ChDir

The ChDir function changes the current working folder.

Usage

Used to change the current working folder. This statement is automatically generated in Recording mode when you start Recording mode by Launching an application and you specify in Launching a program dialog box a working folder.

Syntax

ret = ChDir(<folder_name>)

Parameters

<folder_name>. string, name of the folder to change to.

Return value

ret, optional numeric return value. If the function succeeds, the return value is 0. If the function fails, the return value is a nonzero value (see System Functions Error Codes).

See also

CurDir$

Examples

ChDir("I:\docword")

direct$="c:\program files (x86)"
ChDir(direct$)