Re: How to open a windows folder ?



uses shellapi;
begin
shellexecute(handle,'open','C:\windows\system32',nil,nil,sw_shownormal);
end;

And you could extract the location of the windows folder from the environment variable SystemRoot;


function GetEnvironmentString(s:string):string;
begin
SetLength(Result,8192);
SetLength(Result,Windows.GetEnvironmentVariable(PChar(s),PChar(Result),8192));
end;

sysroot:=GetEnvironmentString('systemroot');
shellexecute(handle,'open',sysroot,nil,nil,sw_shownormal);
.