Sunday, October 20, 2013

Basic bat file

The command prompt (cmd) on Windows systems provides an easy and yet 'technical' way of managing your system.
Knowing one or two of these commands could save you a lot of time sometimes. So today I'll be sharing a few of these commands just for a start.

SHUTDOWN/RESTART

Traditionally, we all like to click here and there to get things done. What if we could be more geeky once in a while? This command simply shuts down or restart your system. You can even assign a time for which the process should take place. Ok enough talking. Let's get down to business.

First, open your command prompt by simply typing in 'cmd' (without quotes) at the start screen. Your cmd window shoukd be visible now. Type the ff in the window:

shutdown -s -t 60

Obviously, shutdown means shutdown.
-s means shutdown as well (kinda weird)
-t is specifying the time (in seconds). So the 60 that follows is sixty seconds, i.e one minute.

We could also replace -s with -p or -r, where they mean power-off and restart respectively.

Alternatively, you can simply open notepad and type in any of the commands, then save them with a (.bat)  extension. For example, you'll save the first command as shutdown.bat

So when you run the file, it simply does the same thing as typing it in the cmd window.

So that's it. Try it out and let's here about it in the comments.

More to come later.