Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Getwin_Click()
Dim Buffer As String * 255
rtn = GetWindowsDirectory(Buffer, Len(Buffer))
WinPath = Left(Buffer, rtn)
Windir.Text = WinPath
End Sub