OpenList 静默运行脚本

OpenList 静默运行脚本

创建 start_no_window.bat

@echo off
cd /d "%~dp0"
powershell.exe -ExecutionPolicy Bypass -Command "Start-Process -FilePath '.\openlist.exe' -ArgumentList 'server' -WindowStyle Hidden"

说明:

  • powershell.exe : 调用 PowerShell。
  • -ExecutionPolicy : 临时绕过执行策略,允许运行脚本。
  • Start-Process : 启动一个新进程。
  • -FilePath : 要启动的进程是当前目录下的 openlist.exe
  • -ArgumentList :新进程的运行参数。
  • -WindowStyle Hidden : 关键参数,用于隐藏窗口。

(可选) 以管理员身份运行

如果 OpenList 需要管理员权限来访问某些目录,只需在 PowerShell 命令中添加 -Verb RunAs 参数即可。

修改后的 start_no_window.bat 内容如下:

@echo off
cd /d "%~dp0"
powershell.exe -ExecutionPolicy Bypass -Command "Start-Process -FilePath '.\openlist.exe' -ArgumentList 'server' -WindowStyle Hidden -Verb RunAs"

注意: 使用此参数运行时,系统会弹出 UAC 请求授权。


OpenList 静默运行脚本
https://blog.979909.xyz/2026/05/19/OpenList-静默运行脚本/
作者
nafeuy
发布于
2026年5月19日
许可协议