Windows批处理:自动开关程序

公司有台14年组装的PC,时常无故重启,所以编写了个然并卵的批处理来测试稳定性。

打开程序.bat

@echo off
title Start Software
color 2F

:0
"C:Program FilesAdobeAdobe Photoshop CS5 (64 Bit)Photoshop.exe"
ping -n 6 127.0.0.1>%temp%1.tmp
"C:Program Files (x86)AdobeAdobe Dreamweaver CS5Dreamweaver.exe"
ping -n 6 127.0.0.1>%temp%1.tmp
"C:Program Files (x86)AdobeAdobe Flash CS5Flash.exe"
goto 0

关闭程序.bat

@echo off
title Kill Software
color 2F

:0
taskkill /f /im Photoshop.exe
ping -n 8 127.0.0.1>%temp%1.tmp
taskkill /f /im Dreamweaver.exe
ping -n 8 127.0.0.1>%temp%1.tmp
taskkill /f /im Flash.exe
ping -n 8 127.0.0.1>%temp%1.tmp
goto 0

本文出自 “运维菜鸟.log” 博客,谢绝转载!

原文地址:https://www.cnblogs.com/sjy000/p/4775978.html