打开网页:
@echo off
title 打开网页
start C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe http://www.google.com.hk
关闭浏览器:
@echo off
title 结束进程
taskkill /f /t /im iexplore.exe
taskkill /f /t /im chrome.exe
taskkill /f /t /im firefox.exe
/IM imagename 指定要终止的进程的映像名称。通配符 ‘*’可用来
指定所有任务或映像名称。
/T 终止指定的进程和由它启用的子进程。
/F 指定强制终止进程。
完整脚本实例
@echo off
start iexplore.exe http://www.test.com
ping -n 15 127.0.0.1>nul
taskkill /f /im iexplore.exe
exit
ping -n 15 127.0.0.1>nul 代表等待时间