![]() |
Wie finde ich die Windows Systempfade z.B : C:\Windows\temp
Wie finde ich die Windowssystemordner z.B:
TEMP SYSTEM, SYSTEM32 ,Installationspfad \Windows oder \WINNT. Mit foglenden Functionen geht das. 1.) Windows Temp auslesen Uses Windows.pas "Normalerweise automatisch eingebunden"
Delphi-Quellcode:
2.) Installationsordner von Windows
Function TempPath:String;
var buf:Pointer; begin GetMem(buf,MAX_PATH); GetTempPathA(MAX_PATH,buf); TempPath:=strpas(buf); FreeMem(buf,MAX_PATH); end; Uses Windowspas "Normalerweise automatisch eingebunden"
Delphi-Quellcode:
3.) Der Windows Systemordner
Function WinDowsDir:String;
var a : Array[0..MAX_PATH] of char; Temp:String; begin GetWindowsDirectory(a, sizeof(a)); Temp:=(StrPas(a)); Temp:=copy(temp,length(temp),1); /// Abschließenden Slash anfügen ! if Temp='\' then WinDowsDir:=((trim(StrPas(a)))) else WinDowsDir:=((trim(StrPas(a))))+'\'; end;
Delphi-Quellcode:
Gruß Frank
Function SysDir:String;
var a : Array[0..MAX_PATH] of char; Temp:String; begin GetSystemDirectory(a, sizeof(a)); Temp:=(StrPas(a)); Temp:=copy(temp,length(temp),1); /// Abschließenden Slash anfügen ! if Temp='\' then GetSysDir:=((trim(StrPas(a)))) else GetSysDir:=((trim(StrPas(a))))+'\'; end; [edit=Luckie] Mfg, Luckie[/edit] [edit=Matze]Code formatiert. Mfg, Matze[/edit] |
Re: Wie finde ich die Windows Systempfade z.B : C:\Windows\t
Mhm hast du dir das hier schon mal angekuckt?
![]() [edit=Chakotay1308] Mfg, Chakotay1308[/edit] |
Re: Wie finde ich die Windows Systempfade z.B : C:\Windows\t
Also ich hätte es j aso gemacht:
Delphi-Quellcode:
Und:
function GetSysDir: String;
const UNLEN = MAX_PATH; var Size: DWORD; buffer : array[0..UNLEN] of Char; begin Size := UNLEN + 1; if GetSystemDirectory(buffer, Size) <> 0 then result := String(buffer) else result := ''; end;
Delphi-Quellcode:
function GetWinDir: String;
const UNLEN = MAX_PATH; var Size: DWORD; buffer : array[0..UNLEN] of Char; begin Size := UNLEN + 1; if GetWindowsDirectory(buffer, Size) <> 0 then result := String(buffer) else result := ''; end; |
Re: Wie finde ich die Windows Systempfade z.B : C:\Windows\t
Und ich würde es so machen:
![]() Allerdings fehlen da die Definitionen für CSIDL_SYSTEM und CSIDL_WINDOWS:
Code:
Chris
CSIDL_SYSTEM $25
CSIDL_WINDOWS $24 |
Re: Wie finde ich die Windows Systempfade z.B : C:\Windows\t
Liste der Anhänge anzeigen (Anzahl: 1)
Also, es gibt da diese Unit "environ" (s. anhang), mit der man Umgebungsvariablen bequem herholen kann... Ich habe sie nicht geschrieben, Copyright beachten! Ich hoffe das war gemeint..
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz