I have a Windows 7 with C totally (system) encrypted with truecrypt. Every day - when I sleep - it executes this batch via Windows planned activities windowslock.bat C:\Windows\System32\rundll32.exe user32.dll,LockWorkStation So even if I could forget to lock the screen, the day after it will be locked. But this is not a long-term solution because maybe I cannot come back to switch off the computer and somebody could hack the lock-screen or try to exploit something via lan. I need have it switched off automatically. But only if it stays locked for 4 days. This is the reason why I need another script: when this second script is run, it should test if I'm not using my computer for 4 consecutive days and then the script should force my computer to shutdown - with no questions/prompts asked, otherwise it will fail. after that, my computer will be OFF with truecrypt protecting my documents. the script should not shutdown the computer if I am starting to use it after 1 or 2 days otherwise the unexpected shutdown could interfere with my work. How the batch should know if I am using my computer or not? I think it should count the days it stays with locked screen and reset the counter when the screen is unlocked. Any hint? Thanks.