Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Open DOS window at folder


Dim C As String
If IsWinNTPlus Then
   C = "cmd "          'WinNT / 2000 / XP command line processor
Else
   C = "command "      'Win95/98/ME command processor
End If
Shell C & " /K chdir /D " & FolderResults(lstFolders.ListIndex), vbNormalFocus


Public Function IsWinNTPlus() As Boolean
'returns True if running Windows NT, 2000 or XP
   #If Win32 Then
      Dim OSV As OSVERSIONINFO
     OSV.OSVSize = Len(OSV)
      If GetVersionEx(OSV) = 1 Then
        IsWinNTPlus = (OSV.PlatformID = VER_PLATFORM_WIN32_NT) And (OSV.dwVerMajor >= 4)
      End If
  # End If
End Function