'Hämtar sökvägen till Windows
Dim WinDir As String
Dim slength As Long
WinDir = Space(255)
slength = GetWindowsDirectory(WinDir, 255)
WinDir = Left(WinDir, slength) ' extract the returned string from the buffer
'Skriver ut ett meddelande med sökvägen till Windows
MsgBox WinDir