how to execute a batch when computer is on IDLE

Page 1 of 7 123 ... LastLast

  1. Posts : 181
    10, server 2016, server2012
       #1

    how to execute a batch when computer is on IDLE


    network adapter is crappy and would constantly require reset but I dont wish it to reset when im using it and when its working. only when its not functioning propoerly and im using it, I can do it manually.

    however any othertime I wish to reset it automatically when im not around.

    I found this link how to make a .bat file "activate" when the PC sleeps - Stack Overflow

    If I were to go the similar method, is there a kernel ID for "idle"? that link specifically talks about when computer is at sleep but I dont put my computer to sleep, its turned off. also say if theres a way to do it either via above kernel ID or another method, what constitutes idle? sometimes window background task would be running and that wouldnt be idle?

    though I have my screen shut off after 3-5 minutes of inactivity so if theres a kernel ID that reads the screenshut off it would work as well.
      My Computer


  2. Posts : 4,801
    Windows 11 Pro 64 Bit 22H2
       #2

    I dont put my computer to sleep, its turned off.......what constitutes idle?
    When your computer is Idle, it means it is not in use. The computer will be on and the screen may be on or the screen may be in sleep mode, you are just not using it.
    You cannot run any batch command or reset your network adapter while the computer is turned off.; The computer has to be powered on to run any command or task.

    How do you Reset you Network Adapter? Have you tried downloading the latest driver from your computer or motherboard manufacturer?
      My Computer


  3. Posts : 181
    10, server 2016, server2012
    Thread Starter
       #3

    spunk said:
    When your computer is Idle, it means it is not in use. The computer will be on and the screen may be on or the screen may be in sleep mode, you are just not using it.
    You cannot run any batch command or reset your network adapter while the computer is turned off.; The computer has to be powered on to run any command or task.

    How do you Reset you Network Adapter? Have you tried downloading the latest driver from your computer or motherboard manufacturer?
    I am not asking to reset adapter when my computer is turned off nor was it ever mentioned once, how do you get that from my original post lol

    I am asking how to reset adapter via task scheduler of some kind (batch/cmd w/e it is) when computer is on idle. idle does not equate to shut off.
      My Computer


  4. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    Task scheduler can use system idle condition as a trigger to run a task.
    how to execute a batch when computer is on IDLE-ts-trigger-idle.png


    Good luck,
    Denis
      My Computer


  5. Posts : 4,801
    Windows 11 Pro 64 Bit 22H2
       #5

    m18xr2 said:
    I dont put my computer to sleep, its turned off. .
    m18xr2 said:
    how do you get that from my original post lol
    This is how I got that from your OP.
      My Computer


  6. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #6

    m18xr2 said:
    network adapter is crappy ... constantly require reset ... I can do it manually.
    Just to avoid misunderstandings, exactly what do you do manually?

    m18xr2 said:
    when its not functioning properly
    In what circumstances does it go wrong?



    Denis
    Last edited by Try3; 24 Oct 2023 at 19:49.
      My Computer


  7. Posts : 181
    10, server 2016, server2012
    Thread Starter
       #7

    Try3 said:
    Just to avoid misunderstandings, exactly what do you do manually?

    In what circumstances does it go wrong?

    Denis
    it disconnect from internet and either I have to unplug/replug USB wifi adapter, or using batch to turn off/on again then it'll be fine again. Also I find that having it on too long causes bluescreen which something I gave up on troubleshooting as I tried LAN, 5 different WLAN adapters/pcie card alike, and like 4-5 drivers per adapters (25-30 different drivers).

    so now I just reset them manually, but I dont wish it auto reset while working but still wish for auto reset ONLY when computer is idle (ie. during sleep, or doing other things on another work computer).
      My Computer


  8. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #8

    Idle is not sleep.
    Idle is a condition that happens while the computer is running.
    You can check what power-sleep states you have available by running this command.
    Code:
    PowerCfg -a

    I used to have problems with WiFi adapters sometimes not being able to detect networks after resuming from S3 Sleep or from hibernation.
    When one misbehaved, I used to run a script to disable the WiFi card and then immediately enable it again. Perhaps that's what you meant by, "turn off/on again".


    I am very surprised that your bluescreens are caused by your network adapters.


    All the best,
    Denis
      My Computer


  9. Posts : 181
    10, server 2016, server2012
    Thread Starter
       #9

    Try3 said:
    Idle is not sleep.
    Idle is a condition that happens while the computer is running.
    You can check what power-sleep states you have available by running this command.
    Code:
    PowerCfg -a
    I used to have problems with WiFi adapters sometimes not being able to detect networks after resuming from S3 Sleep or from hibernation.
    When one misbehaved, I used to run a script to disable the WiFi card and then immediately enable it again. Perhaps that's what you meant by, "turn off/on again".

    I am very surprised that your bluescreens are caused by your network adapters.

    All the best,
    Denis
    so.. here are the states

    how to execute a batch when computer is on IDLE-states.png

    many of them says is not supported by the firmware.. lol what the heck. so what is my idle state then?

    theres standby connected and standby S3, whats the difference and it seems only standby S3 is the only option available?
      My Computer


  10. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #10

    S3 Sleep is the sleep state that we have all known for more than a decade.
    The list you posted shows that your objective will not be complicated by the presence of S0 Modern standby [aka S0 Low power idle] so that's a good thing.

    So there's nothing to stop you using Task scheduler to react to an Idle condition as illustrated in post #4 above.


    All the best,
    Denis
      My Computer


 

  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 11:32.
Find Us




Windows 10 Forums