Changes the current drive.
Public Overloads Sub ChDrive(ByVal Drive As { Char | String })
| Exception type | Error number | Condition |
|---|---|---|
| 68 | Invalid drive is specified, or drive is unavailable. |
The ChDrive function requires unmanaged code permission, which may affect its execution in partial trust situations. For more information, see
This example uses the ChDrive function to change the current drive. The function throws an exception if the drive does not exist.
ChDrive("D") ' Make "D" the current drive.
Namespace: Microsoft.VisualBasic
Module: FileSystem
Assembly: Microsoft Visual Basic .NET Runtime (in MicrosoftVisualBasic.dll)
ChDir Function | CurDir Function | MkDir Function | RmDir Function |