3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Program your PC to turn off automatically by asigning which time you want it to do that

Step 2Detailed description of the code in the script...

detailed description of the code in the script...
Dim x and Dim y ///declare the variables x and y responsible for the answer and the time respectively.

set oShell = createobject("wscript.shell") /// calls the OS shell and creates the object wscript.shell

Set Sapi = Wscript.CreateObject("SAPI.SpVoice") ///calls the windows SAPI and creates the object SAPI.SpVoice which is responsible for the speech in this script as it narrates to the user...

x = InputBox("Would you like to shutdown your PC after a preiod of time? answer: yes/no","AUTOMATIC SYSTEM SHUTDOWN! " ///calls the input where the user says if he wants to shut down his PC

if x = "yes" then /// is a branching statement
y = InputBox("Enter time left for shutdown to occur automatically(time in minutes...):","AUTOMATIC SYSTEM SHUTDOWN!") // if the user chooses yes then he is promted by another input to asign the time left for shutdown
sapi.speak y + "minutes left for shutdown" ///the windows SAPI reads the minutes left

oShell.Run "shutdown.exe -s -t " & (y * 60) & " -f -c ""System is now set for automatic shutdown! do not wait for the downloads to finish, you can go to sleep! GOOD NIGHT! see u 2morow! >>>>to terminate this Automatic shutdown just rerun the script and type no""" ///this is the shutdown statement which calls the system shutdown executable to launch and shuts the PC according to the given time which is in this case the variable y!
end if //ends the first if statement which is in this case yes

if x = "no" then //.another is statement responsible for the no answer
sapi.speak "okay, as you wish good bye, script writen by Ayman Farhat the SCRIPTmaster" ///the SAPI speaks to the user and tells him good bye
oShell.run "shutdown.exe -a" / /the shutdown.exe is called in this case and is told not to perform the shutdown by adding -a !
end if // end of the if statement!

that was a breif yet detailed description, know go to the next step to see what to do...

« Previous StepDownload PDFView All StepsNext Step »
1 comment
Jan 8, 2010. 1:57 PMferrari484 says:
 I am glad i am just a little geek. because i don't understand anything of this.
Mar 22, 2010. 8:12 AMrealmouad says:
 hi , if you can not understand this take this easy program you can download it from  here :
http://versus.comlu.com/articles.html

Mar 23, 2010. 12:12 PMferrari484 says:
I meant more or less the script the program it self would probably be quite easy to use, but i don't believe i am able to use it whit vuze. And any way i don't have any use for it.
Jan 21, 2010. 7:34 AMmacmccune says:
diddo

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
8
Followers
5
Author:SCRIPTmaster