Introduction: VBS - Self Writing Shutdown

Picture of VBS - Self Writing Shutdown

this is a cool script that I put together in like 5 mins so here it is .. also please comment ty =] ...

what this script does is it opens cmd, then types 'shutdown -s -f -t 10' ten in makes the computer press enter! it's cool because it looks like the pc has taken control and is shutting down your pc!

please enjoy and comment..
tell me of any bugs or Admin rights.

Step 1: How It Works

Picture of How It Works

all this script uses is:

set shellobj = CreateObject("WScript.Shell") :this makes an object .. for later.

shellobj.run "cmd" :this is using the object we have just made and using it to run cmd.

wscript.sleep 2000 :this make it sleep .. here it sleeps for 2000 minisecs ..i think could be smaller.

shellobj.sendkeys "s" : this uses the object to make it type something here it would type the letter 's'.

the code is attached.
!!!!!!!! make sure you name it .vbs not .itsavbs !!!!!!!!!!
hope you like it please comment on it =]

Comments

El Mano (author)2009-02-10

Can you send the mouse cursor to a place on the screen and then tell it to click or right-click using something like "sendkeys"?

iRule (author)El Mano2009-07-11

i found out how to do this, but its not using vbs its using cmd but don't know if that makes a difference.

f2ko-setcursorposition

i use that web site a lot it has lots of helpful commands and cmd add-ons.
hope i helped .

El Mano (author)iRule2009-07-11

Why, thank you, my good sir! You can also do this with NirCMD.

iRule (author)El Mano2009-02-11

it is very easy in vb.net but i can't find how to do it with .vbs

NetDex (author)2009-07-09

It says Access Denied...

iRule (author)NetDex2009-07-11

if you try this at a school, library, ect. some of there computers have a security system that blocks all cmd commands and some block vbs as well. if it was on your pc check you admin rights because all this does is type a very simple command that is used often.

El Mano (author)2009-02-06

I'm trying to learn a bit about VBS but I can't find any really good (and very few decent) sites about it. How did you aquire your knowledge about VBScript?

iRule (author)El Mano2009-02-07

mostly the w3schools web site ... they have tutorials on all scripts ... but also I have the vb.net program sp the scriptings the same but program dos hard bits for you

J-Manoo7 (author)iRule2009-04-13

on the W3S website all i found was VBScripts for a web page. is this the same thing? or could you give us a link? great instructable!

iRule (author)J-Manoo72009-04-13

most of the scripting is the same but there are bits that are different, but i normally try to make my project myself untill i get stuck then i can just search for that thing eg. send keys... and you get lots of hits telling you how to do that thing.

Lance Mt. (author)2009-02-28

Lol, Cheers for this, i'm able to cut and paste to make a program that asks me which of 4 options i'd like, they start talking to my friends, and it leaves enough time for it siting there they think i'm actaully talking to them and they fall for it everytime... I change it often

iRule (author)Lance Mt.2009-02-28

Lol sounds like fun ... im glad i helped