Create task to disable or enable ethernet adapter Windows 10


  1. Posts : 89
    Windows 10/64
       #1

    Create task to disable or enable ethernet adapter Windows 10


    I'm trying to create a couple tasks (or one if anyone can tell me how) to disable and re-enable my Ethernet adapter at a scheduled time.

    The following commands work fine from an elevated command prompt:
    disable: "netsh interface set interface “Ethernet” DISABLED"
    enable: "netsh interface set interface “Ethernet” ENABLED"

    But trying to run .bat or .cmd files by starting them directly or in task scheduler or setting up the command directly in the scheduled task don't seem to work (I even tried creating a shortcut to the bat/cmd file and setting it to run with admin privileges and it still won't work). I have the check box in the General tab selected in the task "run with highest privileges" and it still won't work.

    What am I missing?
      My Computer


  2. Posts : 42,734
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, manually running scheduled task specified to run with highest privileges which executes a bat file containing the following

    netsh interface set interface "Ethernet" DISABLED
    pause
    netsh interface set interface "Ethernet" ENABLED

    works for me.. (note the change in ").
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:12.
Find Us




Windows 10 Forums