Open Windows Explorer, and the focus point to a file

uses

  ShellAPI;

var
  FileName: string;
begin
  FileName := 'D:\tools\cpu-z\cpuz.exe';
  ShellExecute(0, 'Open' ,'explorer.exe', PChar('/e,/select,' + FileName), nil, SW_NORMAL);
end;

-------------------------------------------------- invincible dividing line ----- ------------------------------------------ --------------------

Explorer.exe achieved by a switch.

  Explorer.exe parameters are as follows:
  Syntax Explorer [/ n] [/ e ] [[, / root], [path]] [[, / select], [path filename]]

Parameter Description
  / n expressed in "My Computer" opened a new window usually opens the Windows installation partition's root directory.
  / e expressed in "Explorer" Open a new window is usually open Windows installation root partition.
  / root, [path] Enables specified folder, / root indicates only the specified folder below the display file (folder), and does not show other partition folders; [path] indicates the specified path.
  If not / root parameters, but only [path] parameter may be displayed contents of the other partitions and folders. In addition, [path] can also specify a network shared folder.
  / select, [path filename] Enables the specified folder and select the file specified, [path filename] represents the path and filename specified.
  If not / select parameters, the system will open the file associated with the corresponding program. If [path filename] not with the file name will open the parent directory to the folder and select the folder.


Guess you like

Origin blog.csdn.net/showmessage0804/article/details/7952534