ChDir Statement

現在のディレクトリないしドライブを変更します。

警告マーク

This statement currently does not work as documented. See this issue for more information.


構文:

ChDir Text As String

パラメーター:

Text: ディレクトリパスないしドライブを指定する文字列表式。

注マーク

現在のドライブのみを変更するには、ドライブレターに続けてコロンを指定します。


Error codes:

5 無効なプロシージャー呼び出しです

76 パスが見つかりません

例:

Sub ExampleChDir

Dim sDir1 As String , sDir2 As String

    sDir1 = "c:\Test"

    sDir2 = "d:\Private"

    ChDir( sDir1 )

    MsgBox CurDir

    ChDir( sDir2 )

    MsgBox CurDir

End Sub