Search code examples
windowsnetwork-programmingcmdipconfig

Program that automatically does ipconfig/release and then ipconfig/renew on a timer


As the title says, I want to create a program that automatically does ipconfig/release and then ipconfig/renew, every few minutes. I usually do this in the command prompt, but it would be much more convenient if a program could automate this. I was just wondering where I could even begin to create this program? Or is it impossible to automate this?


Solution

  • untested and likely incomplete for a .cmd file that can be called at startup or login or by task scheduler. It will need administrator rights.

    @echo off
    
    :infiniteloop
    ipconfig /release
    ipconfig /renew
    timeout /t 200
    goto :infiniteloop