Wednesday, September 18, 2013

Schedule a task to reset the network interface on "Startup" or "Return from Hibernation" events.

*Please note that this is for Windows 7.  The "netsh" syntax differs for Windows XP and other versions of windows.  You will have to adjust your batch file accordingly*
  1. Determine the names for your local and wireless connections.  The interface names may differ on your computer so you will need to use the name listed when you run the "ipconfig command":

  2. Create a text file that will reset you local and wireless connections.
    @ECHO OFF
    color 1f
    CLS
    ECHO Disabling network interfaces.
    netsh interface set interface "Local Area Connection" DISABLE
    netsh interface set interface "Wireless Network Connection" DISABLE
    ECHO Enabling network interfaces
    netsh interface set interface "Local Area Connection" ENABLE
    netsh interface set interface "Wireless Network Connection" ENABLE
    Name the file with a .cmd extension such as: "RepairNetwork.cmd"
  3. Create a scheduled task for this command with triggers on "Startup" and "Return from Hibernation".
    1. Task Action:
    2. Startup Trigger:
    3. Return from Hibernation: