From: "Rudy Velthuis (TeamB)" Newsgroups: borland.public.delphi.students Subject: Re: System folder Date: Sat, 27 Oct 2001 21:37:00 +0200 Message-ID: References: <3bdb0994_2@dnews> Organization: Praxis drs. Rudolph Velthuis X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 217.226.79.201 X-Trace: dnews 1004211433 217.226.79.201 (27 Oct 2001 12:37:13 -0700) Lines: 35 X-Authenticated-User: rvelthuis Path: dnews Xref: dnews borland.public.delphi.students:14406 In article <3bdb0994_2@dnews>, Blomerus Calitz says... > Hi everyone!! > > Can someone please tell me how to get the path of the system folder E.G. > C:\Windows or C:\WinNT . . . The system directory would rather be C:\Windows\System, or C:\WinNT\System32, or similar. If you want that, try this (untested) code: function SystemDirectory: string; var Len: Integer; begin Len := GetSystemDirectory(nil, 0); SetLength(Result, Len - 1); GetSystemDirectory(PChar(Result), Len); end; Getting the Windows directory (like C:\Windows or C:\WinNT) is very similar: function WindowsDirectory: string; var Len: Integer; begin Len := GetWindowsDirectory(nil, 0); SetLength(Result, Len - 1); GetWindowsDirectory(PChar(Result), Len); end; -- Rudy Velthuis (TeamB)