Fórum Diretório do Windows #185686
01/10/2003
0
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
Curtir tópico
+ 0
Responder
Posts
01/10/2003
Marlon Spiess
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
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)