Diretório do Windows
Caros colegas,
Como faço para saber o diretório em que está instalado o windows?
E executar um programa apartir dele.
Como faço para saber o diretório em que está instalado o windows?
E executar um programa apartir dele.
Wendel Teixeira
Curtidas 0
Respostas
Marlon Spiess
01/10/2003
Oi vc pode acessar o registro do windows +/- como vou mostrar, mas tem q tomar o cuidado de indicar o caminho correto dentro do registry(regedit).
var
Registry : TRegistry;
Path : string;
Resultado : string;
tipimp : byte;
begin
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_LOCAL_MACHINE;
Path := ´\SOFTWARE\MICROSOFT\WINDOWS\CurrentVersion\SystemRoot´;
if (Registry.KeyExists(Path)) then
Resultado := Registry.ReadString(Path);
Espero ter ajudado
var
Registry : TRegistry;
Path : string;
Resultado : string;
tipimp : byte;
begin
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_LOCAL_MACHINE;
Path := ´\SOFTWARE\MICROSOFT\WINDOWS\CurrentVersion\SystemRoot´;
if (Registry.KeyExists(Path)) then
Resultado := Registry.ReadString(Path);
Espero ter ajudado
GOSTEI 0