Visual Basic Programming Code Examples Visual Basic > Code Snippets Code Examples Get the windows directory . You will need to add a reference to the Microsoft Get the windows directory . You will need to add a reference to the Microsoft Scripting runtime. Private Sub Form_Load() Dim objFso As FileSystemObject Dim WindowsPath As String Set objFso = New FileSystemObject WindowsPath = objFso.GetSpecialFolder(WindowsFolder) MsgBox (WindowsPath) End Sub