Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.02.20;
Скачать: CL | DM;

Вниз

Директория Windows   Найти похожие ветки 

 
Stype ©   (2005-02-08 17:23) [0]

Как узнать директорию, где установленна Windows ?


 
palva ©   (2005-02-08 18:48) [1]

{$APPTYPE CONSOLE}
uses windows;
var s: String;
begin
 SetLength(s, 250);
 SetLength(s, GetWindowsDirectory(PChar(s), 250));
 writeln(s);
end.


 
VMcL ©   (2005-02-08 19:01) [2]

>>palva ©   (08.02.05 18:48) [1]

Только не 250, а MAX_PATH.


 
palva ©   (2005-02-08 19:07) [3]

OK


 
palva ©   (2005-02-08 19:12) [4]

Можно даже так:
{$APPTYPE CONSOLE}
uses windows;
var s: String;
begin
 SetLength(s, GetWindowsDirectory(PChar(s), 0));
 GetWindowsDirectory(PChar(s), Length(s));
 writeln(s);
end.


 
rdm ©   (2005-02-08 22:22) [5]

Caption := SysUtils.GetEnvironmentVariable("windir");


 
VMcL ©   (2005-02-08 22:51) [6]

>>rdm ©   (08.02.05 22:22) [5]

Так делать не следует. Переменную окружения можно изменить.


 
Piter ©   (2005-02-08 23:29) [7]

Директория с Windows это - %SystemRoot%


 
VMcL ©   (2005-02-09 01:02) [8]

>>Piter ©   (08.02.05 23:29) [7]

В Win9x нет SystemRoot, есть только windir, AFAIR.


 
Fay ©   (2005-02-09 03:38) [9]

2 VMcL ©   (08.02.05 19:01) [2]
uSize
[in] Specifies the maximum size, in TCHARs, of the buffer specified by the lpBuffer parameter. This value should be set to MAX_PATH+1 to allow sufficient space for the path and the null terminator.


 
Fay ©   (2005-02-09 03:39) [10]

2 Piter ©   (08.02.05 23:29) [7]
Директория с Windows - это GetWindowsDirectory



Страницы: 1 вся ветка

Текущий архив: 2005.02.20;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.055 c
14-1106976537
Aleksandr
2005-01-29 08:28
2005.02.20
Кто поёт?


14-1107166520
Alexander Panov
2005-01-31 13:15
2005.02.20
Блин, флудеры.


6-1102352885
Anonimus
2004-12-06 20:08
2005.02.20
как скачать страницу


3-1106304368
Grab3
2005-01-21 13:46
2005.02.20
Mysql и Delphi


14-1106939309
Ломброзо
2005-01-28 22:08
2005.02.20
"Что, уже началось?" :-)