命令行打开资源管理器(explorer .)

用 explorer.exe 的命令行参数在当前位置打开资源管理器,或直接定位并选中某个文件。

Windows文件命令提示符打开低风险
输入 explorer . 打开当前文件夹;输入 explorer /select,"C:\路径\文件.txt" 打开其所在文件夹并选中该文件。

01命令

命令
$ explorer .
explorer /select,"C:\Users\me\Downloads\file.zip"

02作用说明

explorer.exe 后面跟文件夹路径就会打开该位置;/select, 参数则会打开父文件夹并高亮选中指定文件,刚下载或刚编译完想看文件时特别方便。在 PowerShell 里也可以用 Invoke-Item .(简写 ii .)达到同样效果。注意 explorer 无论成功与否返回值都是 1,只有在脚本里检查 $? 时才需要留意。

03风险

风险低风险

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • Explorer.exe command-line options - SS64
    SS64 · technical · 2026-09-17
    依据: Documents explorer . to open the current folder and explorer /select,path to open the parent folder with a file selected.

最后验证: 2026-09-18 · 分类: 文件与文件夹

06相关方案