There are those occasions when the windows explorer is needed at a specific location. The following code may be employed to achieve the successful launch programatically.
[codesyntax lang=”delphi” title=”Launch Windows Explorer Targeting Specific Folder”]
procedure TBCSBuildStackC.XQTExplorer(ipath: AnsiString); begin WinExec(PAnsiChar(Self.sys + '\explorer.exe /Select,"' + ipath + '"'), sw_Normal); end;
The sys variable is populated by retrieving the system variable that points to the windows system root.
The ipath variable is the folder location where the explorer should open when launched. It may be populated any number of ways. Typically a open file dialog is employed for that purpose.
The overall result is to launch the windows explorer to that specific folder from a executing Delphi program.
Mr. Arch Brooks, Software Engineer