Mit VB WinSystemPfad ermitteln

Wie bekomme ich in VB heraus, wo die Betriebssystemdateien bzw. die System-DLLs liegen?

Meine Vermutung:
mit API-Befehl GetWindowsDirectory bzw. GetSystemDirectory

Aber wie lautet der korrekte Aufruf? Ich kriege von der API nichts geliefert. Oder gibt es andere Möglichkeiten?

Gruß
Siegfried

UINT GetWindowsDirectory(
LPTSTR lpBuffer, // address of buffer for Windows directory
UINT uSize // size of directory buffer
);

Return Values

If the function succeeds, the return value is the length, in characters, of the string copied to the buffer, not including the terminating null character.
If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

GetSystemdirectory analog

Hi,

unter VB gibt es den Befehl environ
Dieser gibt dir die gewünschten pfade wieder

Z.Bsp environ(„TEMP“)

CIAO

Der korrekte Aufruf muss so gestaltet sein, dass die Variablen vor dem Aufruf der API-Befehle mit einer ausreichenden Grösse (z. B. 255) initialisiert werden müssen!
Siehe Beispiel auf http://www.basicworld.com/vbplus/tt130297.htm

Servus
Roland

[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]