Monday, January 5, 2015

How to Shutdown,Restart, Log off your computer using VBScript

To create a VBScript to shutdown your computer, we need to run shutdown.exe in our VBScript. Follow the below steps in order to create your VBScript.

Step 1. Open Notepad and paste the below code.

Set objshell = CreateObject("WScript.Shell")
= MsgBox("Click YES to Shutdown NO to exit",vbYesNo,"Shutdown")
If Answer = vbYes Then
"shutdown -s -t 00"
End If

Step 2. Click on File and then Save as to Save the file as shutdown.vbs

Save as

Step 3. You are Done. Click on the shutdown.vbs file to shutdown your computer. You can restart, sleep or hibernate your computer by just replacing the statement “shutdown –s –t 00” with the below commands.

To Restart : shutdown –r –t 00

To log off : Shutdown.exe –L

To Hibernate : rundll32.exe PowrProf.dll, SetSuspendState

To sleep : rundll32.exe powrprof.dll,SetSuspendState 0,1,0

To Lock your workstation: Rundll32.exe User32.dll,LockWorkStation

If you find any difficulties please feel free to post your queries in comment section. I will reply to your queries as early as possible. Please do not forget to post your feedback in comment section. If you like this article please do share it with your friend and family on Facebook and Twitter. You can also use Email This feature to send this article to your friends.

You may like:

How to create Shutdown, Restart, Sleep and Hibernate shortcut.

How to schedule your computer to auto shutdown at specific time.


  1. So hard why, you choose for that. When I have lost my file, I just run for the internet and in search found the vcruntime140.dll. Keep that website for those situations. Share it with you, maybe you will find something useful there.

  2. You produced some decent points there. I looked on-line for your problem and found most people is going together with using your site. 4k computer monitor

  3. Everything an enthusiastic Apple owner says about their Apple is true. They are also beautiful looking computers. Midwest Retro Audio

  4. Extraordinary things you've generally imparted to us. Simply continue written work this sort of posts.The time which was squandered in going for educational cost now it can be utilized for studies.Thanks Read the reviews

  5. definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! maggiori informazioni

  6. Regular visits listed here are the easiest method to appreciate your energy, which is why why I am going to the website everyday, searching for new, interesting info. Many, thank you die besten vpn

  7. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you.

  8. I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post

  9. Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, getmoreprivacy

  10. It’s appropriate time to make some plans for the future and it is time to be happy. I have read this post and if I could I wish to suggest you few interesting things or advice. Perhaps you could write next articles referring to this article. I desire to read even more things about it! blockchain jobs australia

  11. You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site privacyonline

  12. Desktop computers are the least portable. They are good for using multiple displays and heavy workloads. Laptops vary in size and portability. Best Computer For College student 2019

  13. While this article and others can help your decision process, the best answer for you is something only you can decide. Be wary of people who are certain that they know what you need.reset windows 10 password

  14. This is exactly equally an excellent content i quite really liked checking. This isn't all the time which i possess potential to work out an issue.