Pages

NirCmd - Free command line tool for Windows XP and Vista

NirCmd - Free command line tool for Windows XP and Vista

Are you scared of using the Windows command prompt to accomplish tasks? If so, you’re definitely missing out on some cool stuff you can do on your computer. However, it’s understandable as the syntax can be quite technical and you really don’t want to mess something up if you don’t know what you’re doing.

Luckily, there is a free utility called NirCmd that you can use that extends the functionality of the command prompt and makes it a little bit easier to use DOS commands without having to know DOS.

NirCmd is a small command-line utility that allows you to do some useful tasks without displaying any command prompt user interface.

You can use it to do all kinds of useful stuff for you such as writing and deleting values registry keys, writing values into INI file, dialing your Internet account or connecting to a VPN network, restarting windows or shutting down the computer, creating a shortcut to a file, chaning the created/modified date of a file , changing your display settings, turning off your monitor (this we want ) , opening the door of your CD-ROM drive, and lots more!

The best thing about this program is that you can create a scheduled task to simple run any command you want at a set interval. So you can create a scheduled task to turn off your monitor or turn off your computer every day at midnight or to mute the volume on your computer every morning.




Now you could simply run any of the commands by going to the Windows command prompt and typing something in. For example, go to Start, then Run and then type in CMD. Now type in any command that was listed in the command list.

OR Just Create a Shortcut Like This.



Thats It ... Now You not only Tech Savvy ... Now You are Eco Savvy Too There is another utility called "WizMo" also serves the same purpose both are free, you can get them by (what I can say just ) google .





Here is High Tech Way - Recommended For Power Users only

PROGRAMMATICALLY



Code:

// console application
#include

#define SCREENSAVER_START 1
#define MONITOR_OFF 2

int main( int argc, char** argv )
{
int cmd = SCREENSAVER_START; // default when run
// is to start screensaver.

// if passed command line argument (no matter
// what it is), just turn off the monitor instead.
if( argc > 1 )
{
// could check argv,
cmd = MONITOR_OFF;
}

switch( cmd )
{
case SCREENSAVER_START:
SendMessage( HWND_TOPMOST,
WM_SYSCOMMAND,
SC_SCREENSAVE,
0 ); // send message to top most window
// for screensaver to start. that's just
// how you programmatically start the screensaver
// under windows!
break;

case MONITOR_OFF:
SendMessage( HWND_BROADCAST,
WM_SYSCOMMAND,
SC_MONITORPOWER,
(LPARAM)2 ); // turn off the monitor.
break;
}
}


Compile This and Make MonitorControl.EXE

Keep this Executable in Start Menu (or wherever you want ). And create 2 shortcuts:

One called “Monitor OFF” that has target

C:\Documents and Settings\All Users\Start Menu\Programs\Monitor Control\MonitorControl.exe” off

The other is called “ScreenSaver Start” and has target:

C:\Documents and Settings\All Users\Start Menu\Programs\Monitor Control\MonitorControl.exe”

because running the executable with no arguments starts the screensaver.

0 comments: