Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Wandlung %SystemRoot% (https://www.delphipraxis.net/109712-wandlung-systemroot.html)

Astartes 6. Mär 2008 10:36


Wandlung %SystemRoot%
 
Hi,

Ich würde gerne wissen, wie %SystemRoot% zu einem "absoluten Pfad" gewandelt wird?

z.B.
C:\WINNT\System32

Mit freundlichen Gruß
Tom

DeddyH 6. Mär 2008 10:46

Re: Wandlung %SystemRoot%
 
Mal schnell dahergetippt:
Delphi-Quellcode:
var aString: string;
begin
  SetLength(aString,MAX_PATH);
  ExpandEnvironmentStrings('%SystemRoot%',PChar(aString),MAX_PATH - 1);
  SetLength(aString,StrLen(PChar(aString)));
  ShowMessage(aString);
end;

marabu 6. Mär 2008 12:32

Re: Wandlung %SystemRoot%
 
Hallo,

hier noch eine abgepackte Lösung: klick

Freundliche Grüße

DeddyH 6. Mär 2008 12:48

Re: Wandlung %SystemRoot%
 
Zumindest war ich auf dem richtigen Weg :zwinker:

Astartes 6. Mär 2008 15:41

Re: Wandlung %SystemRoot%
 
Danke :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz