Bat批处理文件调用服务器的PHP文件时所遇到的问题

PHP/Apache/Nginx

原来的写法如此,执行时无法删除临时文件。

@echo off
start “” “http://xxxx.com/xxx/xxx.php”
taskkill /f /im iexplore.exe
exit

感觉看不到ie打开,只是一闪而过。而单独在地址栏执行php是成功的。故考虑对ie打开后延迟几秒在kill进程。成功!

@echo off
start “” “http://xxxx.com/xxx/xxx.php”
ping 127.0.0.1 -n 3 >nul –延迟3秒
taskkill /f /im iexplore.exe
exit