Code Snippet
Public Declare Auto Function GetPrinterDriverDirectory _
Lib "winspool.drv" ( _
ByVal pName As String, _
ByVal pEnvironment As String, _
ByVal Level As Integer, _
ByVal pDriverDirectory As System.Text.StringBuilder, _
ByVal cbBuf As Integer, _
ByRef pcbNeeded As Integer) As Boolean
Public Shared Function GetPrinterDriverDirectory() As String
Dim driverDirectory As New System.Text.StringBuilder(256)
Dim cbNeeded As Integer = 0
If GetPrinterDriverDirectory( _
Nothing, Nothing, 1, _
driverDirectory, driverDirectory.Capacity + 1, cbNeeded) Then
Return driverDirectory.ToString()
Else
Throw New System.ComponentModel.Win32Exception
End If
End Function
Public Shared Sub Main()
Dim thePath As String = GetPrinterDriverDirectory()
End Sub