Showing posts with label Vbscript. Show all posts
Showing posts with label Vbscript. Show all posts

Monday, March 18, 2013

How to Shutdown PC Automatically


Many a times, we feel need of something that can shutdown our PC after sometime, say after 30 minutes.

-while continuing any download, it needs to go outside, then even if Download is 80% over, we have to shut it down.
-while converting a file if any emergency comes in between, then we think, wish someone shut down my PC after 40 minutes!
-while using PC/ Laptop in night, many a times, we sleep without shutting it down and it is ON for entire Night.
auto shut down pc


In many such cases, either we left our PC open for too long time without any use(wasting Power)  or we have to shut it down unwillingly.

I have a solution for you that too without need of installing any software(installing too much software also slows down your system).


Solution

Here is a VbScript Program written specially to solve this Problem. 

To enable you Automatically Shutdown your PC at your own wish after the time specified by you.

How to achieve it?

Option 1:


-Download this Zipped file: Autoshut
-Extract the file: right click on zipped file->Extract here->Give password: techsoln
-Now you have the file 'Auto shutdown_Tech-Soln.vbs' . Use when you need 'Automatic shut down your PC' with simple procedure as discussed below.

Option 2:

 -Create the Vbscript yourself:

Let us see the script first:


Dim Ans
Dim Time

set oShell = createobject("wscript.shell")
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")

Ans = InputBox(" Do You Wish to Auto Shutdown this PC ?       Press Y/N  ","  AutoShut  by Tech-Soln")

if Ans = "Y" then
Time = InputBox("After how many minutes Should this PC Shutdown Automatically ? ","  Time in Minutes  by Tech-Soln")
Sapi.speak Time + "minutes left for pc to shutdown Automatically, You can relax without tension  Brought to you by Tech-Soln.blogspot.com "
oShell.Run "shutdown.exe -s -t " & (Time * 60) & " -f -c ""This PC is set for Automatic Shutdown, Finish and save current work. To Cancel Auto Shutdown, Reopen this File And Press N"""

end if
if Ans = "N" then
Sapi.speak " Have a nice day ahead! Keep Smiling! "
oShell.run "shutdown.exe -a"
end if
 

What you have to do?
- Copy entire script from above(with precaution)
- Open Notepad
   Click 'Start'-> Type 'Notepad' in search box->open (Win vista & Win 7)
   Click 'Start'->Run-> Type 'Notepad'-> enter (Win XP)

- Paste
- Go to 'File'->'Save as'
- In save as Window, in save as type, select 'All Files' , In File Name, give any name but put '.vbs' in the end. For example, 'AutoShut.vbs'
-Save it preferably in Desktop(for easy access)

Save As

Saturday, March 16, 2013

How to Know PC's Gender

PC
Do you know whether your PC or Laptop is Male or Female?
Surprised??

- I'll show you how to verify. I am not kidding, you will listen his/her voice yourself.


Still don't believe me!!

Let me show you,

It is just simple code, You have two Options now


Option 1:

-Download the zipped file: PC Gender
-Extract the file: right click on zipped file->Extract here->Give password: techsoln
-Now you have the file 'Auto shutdown_Tech-Soln.vbs' .

Option 2: 


-Create the File yourself
-Open Notepad and write this simple code or just copy & Paste(with precaution) :


CreateObject("SAPI.SpVoice").Speak"I Love You"


Save as this as ' PC_Gender.vbs ' as shown in figure:

Save as ' PC_Gender.vbs '

Now to know Gender of your PC, Keep your PC Speaker ON and double click on ' PC_Gender.vbs ' and Listen its voice, whether it is Male Voice or Female Voice?


My Mom used to say, My Laptop is my girlfriend as I always keep it with me.
And it turned out to be Female. :)

But My Working PC is Male. :(

Check yours and tell me.


Have Fun :)