Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从浏览器打印 pdf 文件,所以我创建了一个自定义 URL 协议来触发 bat 文件,现在我需要阻止命令提示符窗口打开,还需要保护 bat 文件不被用户编辑边。
打开记事本并添加以下内容,然后将文件另存为hidebatch.vbs:
echo Set MyScript = CreateObject("WScript.Shell") echo MyScript.Run "C:\Path\to\your\batchfile.bat", 0, False
只需替换C:\Path\to\your\batchfile.bat为批处理文件的路径即可。然后启动它,而不是启动你的批处理文件,你会运行cscript hidebatch.vbs
C:\Path\to\your\batchfile.bat
cscript hidebatch.vbs