Automatic log off using ezlogoff in Windows

I don’t know why but using the default shutdown.exe to log off my computer automatically via task scheduler doesn’t seem to work. So I tried looking for alternative command line tool to do it, I found and tried ezlogoff, and I think it works perfectly. FYI it can do many things other than logging off, you can check out the documentations if you’re interested.

Here are the steps to set up the automatic logoff using ezlogoff :

  1. Download ezlogoff
  2. Copy ezlogoff.exe to C:\Windows
  3. Open task scheduler as administrator > new basic task
  4. Put this as the action : ezlogoff -m:"You will be logged out automatically in 3 minutes. Please save all your work, any unsaved changes will be lost." -t:180 -a -l
  5. Open properties after you’re done
  6. Check both “Run whether use is logged on or not” and “Run with highest privileges”
  7. Fix the triggers
  8. Conditions > power > uncheck “Start…” and “Stop…”