Mega Code Archive

 
Categories / Delphi / API
 

Opening an explorer window to a given folder

Question: How can I open an explorer window to a given folder? Answer: A) The following example opens a explorer window containing the contents of the Windows directory. Example: uses ShellApi; procedure TForm1.Button1Click(Sender: TObject); begin ShellExecute(0, 'explore', 'C:\WINDOWS', nil, nil, SW_SHOWNORMAL); end;