引用:
作者: changzg
|
写一个小batch, 先断网,再launch, 再连网。已验证。
sample code here, note: mine is ethernet instead of WiFi.
@echo off
echo Disabling Ethernet...
powershell -Command "Start-Process cmd -Verb runAs -ArgumentList '/c netsh interface set interface \"Ethernet\" admin=disable'"
echo Waiting for Ethernet to be disabled...
timeout /t 5
echo Launching "TurboTax2022"...
start "" "C:\Program Files\TurboTax2022\tt2022.exe"
echo Waiting for "TurboTax2022" to launch...
timeout /t 30
echo Enabling Ethernet...
powershell -Command "Start-Process cmd -Verb runAs -ArgumentList '/c netsh interface set interface \"Ethernet\" admin=enable'"
echo Done!