TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Hibernate only on certain nights

    Windows
    1
    1
    246
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • XanderX
      Xander
      last edited by

      When I say 'good night' to Alexa, I have been having it run my Hibernate command every night to put my PC to sleep. I got to thinking that sometimes I do want certain programs to run backups, etc. so did a little digging and found this script online.
      So, every Sunday night, it -won't- hibernate and will run certain tasks.

      @echo off
      for /f %%i in ('powershell ^(get-date^).DayOfWeek') do set dow=%%i
      if %dow% NEQ Sunday goto shutdown
      
      REM in this area, enter commands for things to run Sunday night (backups, updates, etc)
      
      exit
      :shutdown
      shutdown /h /f
      
      1 Reply Last reply Reply Quote 1
      • First post
        Last post