一、使用Powershell安装腾讯QQ
$Path = $env:TEMP;
$Installer = "qq_installer.exe";
Invoke-WebRequest -UseBasicParsing "https://down.qq.com/qqweb/PCQQ/PCQQ_EXE/PCQQ2021.exe" -OutFile $Path\$Installer;
Start-Process -FilePath $Path\$Installer -Args "/s" -Verb RunAs -Wait;
Remove-Item $Path\$Installer
二、查找进程列表、杀进程、启动exe、重启进程
tasklist /FI "IMAGENAME eq Tomcat8-8080.exe"
Stop-Process -Name chrome
taskkill /f /t /im chrome.exe
taskkill /fi "imagename eq SV_Client.EXE" /f
Start-Process -FilePath ping.exe -ArgumentList "www.baidu.com -n 10" -NoNewWindow
Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList "www.baidu.com -n 10" -NoNewWindow
while($true)
{
if((get-service Tomcat8-8080 |select -ExpandProperty status) -eq “stopped”){Restart-Service Tomcat8-8080}
sleep 300
}
三、重启vpn
posersehll里面可以使用cmd命令,因此尽量使用powershell。
Stop-Process -Name SV_Client
Start-Process -FilePath "C:\Program Files (x86)\VONE\TopSecSV\SV_Client.exe" -ArgumentList "www.baidu.com -n 10" -NoNewWindow
tasklist /FI "IMAGENAME eq SV_Client.exe"