window打开指定目录下文件并选中

在开始运行中输入:


"C:WINDOWSexplorer.exe" /n,/select,"C:ActionScript3.0完全自学视频教程_A.rar"

最后一个参数为 文件的路径 此时打开目录c: 并且选中ActionScript3.0完全自学视频教程_A.rar文件 只能用不能用/


在c++中实现


char openExecute[MAX_PATH]="";
strcat(openExecute,"/select, ");
strcat(openExecute,“C:\ActionScript3.0完全自学视频教程_A.rar”);
ShellExecute(
NULL,
_T("open"),
_T("Explorer.exe"),
_T(openExecute),
NULL,
SW_SHOWDEFAULT);

原文地址:https://www.cnblogs.com/liaomin416100569/p/9331309.html