システムディレクトリを取得する

これは簡単です。以下のサンプルは上が Windowsディレクトリを、下が Systemディレクトリを取得する例です。

■ Windowsディレクトリを取得する例
  procedure TForm1.Button1Click(Sender: TObject);
  var
    chrWinPath  : array [0..MAX_PATH] of char;
  begin
    GetWindowsDirectory(chrWinPath, sizeof(chrWinPath));
    ShowMessage(chrWinPath);
  end;

■ Systemディレクトリを取得する例
  procedure TForm1.Button11Click(Sender: TObject);
  var
    chrSysPath  : array [0..MAX_PATH] of char;
  begin
    GetSystemDirectory(chrSysPath, sizeof(chrSysPath));  
    ShowMessage(chrSysPath);
  end;