Rainmeter Samurize utilities


(command-line utility)

suspend puts your PC to sleep (or prevents it) under very controlled conditions. It can watch out for a running process, an open window, a locked file, audio playing, etc. It also logs the exact condition your PC was in when it went to sleep.


I wrote suspend because the power options in Windows are not sufficiently configurable for me. suspend lets me control precisely when Windows is allowed to (or foreced to) go to sleep.


suspend reads its settings from a file called suspend.ini, which should be in the same folder as suspend.exe.








command=C:\onresume.bat [TopProcess]
IdleTime Idle time (min), after which your PC can enter sleep mode. Measured from last keystroke/mouse move.
CPU Allowed CPU usage (%). CPU usage above this level will prevent sleep mode.
AudioCheck If audio is coming from the sound card, it will prevent sleep mode. Good for watching movies for a long time.
Process If this process is active, it will prevent sleep mode. Don't use ".exe" in the process name. You can list up to 4 processes.
FileExists If this file exists, it will prevent sleep mode.
FileLock If this file is locked, it will prevent sleep mode. If you use a wildcard "*" (e.g. "C:\*.mpg"), suspend will check the most recent file that matches this pattern. List up to 4 files.
Window Window title. If this window is active (has focus), it will prevent sleep mode. Partial match is allowed at the beginning of the title, e.g. "-w Netflix" will match "Netflix - Film 1" and "Netflix - Film 2". List up to 4 window titles.
Suspend Command to run before going to sleep.
prevent it this file exists, it will prevent the execution of the above command
Resume Command to run when Windows wakes up from sleep
TopProcess If CPU usage is high enough to prevent sleep mode, log the most CPU-intensive processes (up to 5).


suspend logs its activity in a file called suspend.log, in the same folder as suspend.exe.

10/01/2010 3:12:19 PM
Start monitoring
Idle time allowed: 30 min
CPU allowed: 6 %
Monitor file lock [1]: "C:\SageTV\*.mpg" Monitor process [1]: "comskip" Monitor active window [1]: "Netflix"
Run before sleep: "C:\test.bat" 10/01/2010 3:22:45 PM
Sleep mode prevented:
Idle time: 0 min
CPU usage: 20.60 %
Top processes:
1. "Idle", CPU: 75.79 %, RAM: 0 MB
2. "comskip", CPU: 11.66 %, RAM: 18 MB
10/01/2010 4:48:21 PM ===================== Suspending system: Idle time: 30 min CPU usage: 0 % File lock status [1]: False ("C:\SagetTV\*.mpg") Proc. status [1]: False ("comskip") 10/01/2010 5:01:38 PM ===================== System resume

The per-process and total CPU usage data may not add up to 100% because they're computed using different algorithms at slightly different points in time.


suspend requires .NET Framework. Chances are you already have it installed. Also, suspend works on its own: your PC's power options should be off to avoid conflicts.

Download suspend_1.2.zip (201K)