copying files w/ GetWindowsDirectoryPosted by p12174 Doug on November 03, 2001 at 09:31:59: i have some code that i've been working on, utilizing the "GetWindowsDirectory" parameters/functions, etc.. the code that i've been working with, is for like opening a file in the \system32 directory of the end user(s) system, without actually knowing the user(s) drive/directory that they installed nt4/2000/xp to.. here's my sample code: procedure TForm1.Button1Click(Sender: TObject); var WinName : String; WindowsDir : Array[0..Max_Path] of Char; begin GetWindowsDirectory(WindowsDir, Max_Path); WinName := StrPas(WindowsDir); Memo1.Lines.LoadFromFile(WinName + '\system32\filename.txt'); Label1.Caption := WinName + '\system32\filename.txt'; end; end. **************************************************** what i'm trying to figure out is this.. how to use the GetWindowsDirectory, but instead of opening a file, "copying" a predetermined/specific file to the "\system32" directory of the users WindowsDir, etc.. any suggestions? i'd love to find a reference somewhere or another on the "GetWindowsDirectory" functions, etc.. and others or similar one's in it's class as well..
|