For lowest prices in India, check out this site

Flipkart.com

Friday, May 8, 2009

A Windows trick

A little .bat file trick

I had been learning how to put custom made batch files (they are the ones with .bat extension) into good use. With a little bit of effort I came up with this batch file. As of now it's a collection of about three files, which causes your system to shutdown. Yes, shutdown.


Now you might be wondering what use can such a file have apart from playing pranks on friends. Maybe not many, but it sure does have one. Say you dont want your friends using your computer withot your permission, but dont want them think you are selfish (which is what happens if you set a password to lock them out of your account). In such a scenario you can use a batch file to cause your system to shutdown as soon as someone logs into it. And when they enquire lust tell them that it's some stupid virus which your antivirus can't get rid of. Trust me, they'll believe you.

Now you might ask, wont the system shutdown when I start using it?. Yes it will. But if you know a particular command you can prevent the system from shutting down (Just type "shutdown -a" without the quotes in the command prompt).And thats the beauty of it all. You can use your computer, while anyone else trying to do so without your permission can't. And I have set a delay of 59 seconds so that you may use the shutdown -a command in the command prompt to prevent the shutdown.

But there is a loophole. The whole process will start only if the batch file is executed at every login. Therefore I went ahead and added a registry entry which does exactly that.

I know only the basics of using .bat files and am trying to improve my bat file. I am particularly interested in reducing the number of files.I have not uploaded the file since it is still under testing. I'll surely upload it once I have finalised the file.

Afterthought:
The batch file is pretty basic and wont prevent advanced users from using your system.

Acknowledgements:
I am deeply in debt of my friend Dhandeep to whom I owe a lot of my batch file programming skills.

So long everyone [Right now, I think I'm the only one visiting this page. ;-) ]

3 comments:

  1. oh so this is y u were askin me the code
    thats nice
    !!!
    i ll give u more

    ReplyDelete
  2. I visited too :P
    -Anand(my stuffs with you remember? hehe)
    And P.S. your phones not reacheable.. call me as soon as you see this.
    And if u dnt hav my number there always facebook to send me a msg.

    ReplyDelete
  3. This web site really has all of the information I needed concerning this subject and didn't know who to ask.


    Also visit my website great djs online

    ReplyDelete