Sets a new current directory or folder.
ChDir path |
The required argument path is a string that specifies a new current directory (or folder). The path argument may contain the disk name. If the disk name is not specified, ChDir assumes it's the current disk.
The ChDir statement changes the current directory, but doesn't change the current disk. For instance, if drive C is current, the command below will change the current directory to one on drive D, however drive C remains the current drive:
ChDir "D:\TMP"
ChDir Statement (Apple Power Macintosh)
On Power Macintosh the current disk is always changed to the disk, specified in the path. A full path should start with the volume name, a relative path starts with a colon (:). ChDir позволяет указывать в пути любые псевдонимы:
ChDir "MacDrive:Tmp" ' on the Macintosh.
Note, that Microsoft Windows and Macintosh use different symbols for relative path changes:
ChDir ".." ' Go up one level in Microsoft Windows.
ChDir "::" ' Go up one level on the Macintosh.
' Change current directory or folder to "MYDIR". ChDir "MYDIR" 'In Microsoft Windows: ' Current disk is drive "C:". The following statement sets a new current ' directory on drive "D:". "C:" remains current drive. ChDir "D:\WINDOWS\SYSTEM" ' On the Macintosh: ' Changes current folder and current drive. ChDir "HD:MY FOLDER" |
See Also |
ChDrive Statement, MkDir Statement , RmDir Statement, CurDir Statement, Dir Function |