How to use NirCMD to manage your computer’s power settings

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.

In

Talk to me!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from David Artiss

Subscribe now to keep reading and get access to the full archive.

Continue reading