Due to updates, over time, that have been made to the site and the age of this article, this post may not display correctly. In particular images may be missing or product reviews display incorrectly.

If this is the case and you'd particularly like me to fix it, then please reach out to me on Twitter.

I think we’d all agree that whatever we can to save energy is not only good the environment but also for our pockets. Many of us will their power settings so that the monitor switches off after so long. Of course, you don’t want this to happen just because you’re having a good think about something you’ve been typing, so it likely to be after 10 minutes or more. And that’s not handy if you’re going off for a few minutes to make a cup of tea.

At work, they demand we lock our PCs when we leave (ctrl/alt/delete and then “lock computer”). However, if you set up a screensaver (to go blank, for example) you can set it sign you off – essentially locking the computer.

So, wouldn’t it be much easier to have a big button you can press everytime you leave your desk that would not only lock the computer but turn the monitor off too?

A-ha, and I’m sure you could sense this coming, there is an answer…

First of all, download the free NirCMD program. This lets you, via command line parameters, to do various thing with your PC.

Place nircmd.exe into a folder of your choice.

Now create a new file, possibly best in the same folder, named Monitor Off.js. It should contain the following code…

var wsh = new ActiveXObject('WScript.Shell');
if (wsh) {
wsh.Run(""[pato to]\nircmd.exe"screensaver");
wsh.Run(""[path to]\nircmd.exe"monitor off");

Where [path to] should be replaced with the path to your folder. Each backslash should be repeated, so a folder of C:Program FilesMonitor Off should be translated to C:\Program Files\Monitor Off

If you don’t wish the screensaver to cut in, but just turn the monitor off then you simply need to remove the “screensaver” line in the above code.

Then simply, create a shortcut to the above Monitor Off.js file. Bob’s your uncle.

And if you read up some more on the NirCMD site, you’ll find there’s a whole host of other things that you can get it to do – all at the click of a button.