I have two .bat files in use to toggle my Internet connection:
1) "ipconfig /release" (to switch off)
2) "ipconfig /renew" (to switch on)
Could somebody please rewrite it, so I can use ONE single file instead of two?
Specifically:
This uses a toggle file in the batch file directory to implement the behaviour.
pushd
if exist __toggle__.txt (
del __toggle__.txt
ipconfig /renew
) else (
echo. > __toggle__.txt
ipconfig /release
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.