How to get current directory using API
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 | 'System & API - How to get current directory using API Private Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" _ (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Private Sub Form_Load() Dim cwd As String Dim length As Long cwd = Space(128) length = GetCurrentDirectory(128, cwd) cwd = Left(cwd, length) MsgBox cwd End End Sub |