如何通过脚本代码显示Windows资源管理器的"文件属性页"?
我在谷歌上搜索过,但没有找到答案。
像... 此代码打开一个 Windows 资源管理器文件夹以查找路径并选择文件。
var path=(path to folder/file)
var str= '"' + path+ '"';
var objShell = new ActiveXObject("WScript.shell");
objShell.Run('explorer.exe /n, /select, ' + str);
objShell = "";
文件上下文菜单具有"属性"选项,用于打开文件的"属性"对话框页面。选择文件后,如何通过脚本打开此对话框?
我发现这个第三方命令行实用程序可以通过传递文件/文件夹/驱动器路径来打开标准 Windows 属性表,但它需要 .net 4.5! :( 极客掉落道具
Windows shell(不是 WScript shell(提供了一个对文件执行操作的 ShellExecute 方法。最常见的操作(谓词(是open
但properties
操作显示属性表对话框。
var shell = new ActiveXObject("shell.application");
shell.ShellExecute("example.txt", "", "", "properties");