I have been playing around with the powercfg utility built into Windows 7, and I came across an interesting command line option:
powercfg /requests
What it does is list the reasons why your computer failed to go to sleep. I had the sleep function enabled on my desktop PC, and I noticed when I came back after a few hours it was still on. The output from the /requests command looked like this:
[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\10.10.30.1\c$\code\SnapShot.cpp] Process ID: [5488]
Ahh. Now I remember…I had a robocopy scheduled to run in the background to backup my code ever hour. Since I no longer needed it, I disabled the schedule.
Now after an hour my system goes to sleep with no problem

{ 1 trackback }
{ 1 comment… read it below or add one }
Thanks for the post. Unfortunately we have a legacy ERP app that seems to keep our 7 machines from sleeping, even though all related processes are terminated and the file is obviously no longer open. This seems to be an issue that MS needs to address in future updates.
[a]