怎么让批处理命令在后台执行
2017-04-08
有时候运行批处理命令要运行很长时间,要是不希望批处理运行过程中出现DOS窗口,或者不想在任务栏看到相关图标,可以通过VBS隐藏窗口运行批处理程序,让它在后台运行。下面就让小编教大家怎么让批处理命令在后台执行吧。
让批处理命令在后台执行的方法
假如我们要后台运行的批处理命令是test.cmd

新建一个文本文件,把扩展名改成.vbs

右键点击这个vbs文件,在弹出的菜单中选择编辑

输入以下命令:
Set ws = CreateObject("Wscript.Shell") ws.run "cmd /c test",vbhide
然后Ctrl+S保存

最后打开这个vbs文件即可

没有dos窗口,也没有任务栏图标,你也可以打开任务管理器在上面找到cmd.exe这就是你后台运行的批处理命令。
