开发者

How can I preselect a file in windows explorer using .net?

开发者 https://www.devze.com 2023-01-02 18:59 出处:网络
How can I popup a windows explorer on a 开发者_如何学Pythonspecific folder with a specific file highlighted ?

How can I popup a windows explorer on a 开发者_如何学Pythonspecific folder with a specific file highlighted ?

I'm interested in solutions for XP, Vista and Windows 7.


There's a "/select" switch in explorer.exe:

"/select,FileName" 

You can use the Process.Start to execute it.


See Explorer.exe Command-Line Options for Windows XP at http://support.microsoft.com/kb/314853

/select,<object> Opens a window view with the specified folder, file, or program selected.

Example 1: Explorer /select,C:\TestDir\TestProg.exe (Opens a window view with TestProg selected.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号