Introduction: Helpful Code for Beginning Computer Users.

Picture of Helpful Code for Beginning Computer Users.

Has a beginner computer user ever asked you, "Is my computer on?" Fret no more- this Instructable will put an end to all "Check if the little light in the corner is blinking!" "Does it say 'Log in?' " "Is there a little icon in the corner of the screen that looks like a bent window?" you've ever had to do. First off, open Notepad.exe. (a.k.a good old Notepad)

What you need:

Basically any version of windows. This code won't work on any version of MacOS. Sorry.

Notepad(Comes with windows)

A keyboard

A mouse

Your wits

Step 1: Open Notepad

Picture of Open Notepad

Once you've opened Notepad, paste this code in:

Set WshShell = WScript.CreateObject("WScript.Shell")

msgbox "Press 'OK' to test whether your computer is on." ,32, "Test"

msgbox "Yes, your computer is on." , 64, "Result"

Step 2: Compilling

Picture of Compilling

Once you've pasted the code in, simply navigate to the upper left corner of the Notepad window, click "File" then "Save As" then rename the code to "IsMyComputerOn.vbs". Don't save yet!

After that, click the drop down menu that says "Text Documents (*.txt)" and change it to "All Files". Then, make sure the other drop down menu that says "Encoding:" is set to ANSI, otherwise it won't work.

Finally, click save.

Step 3: Explanation of Code

Picture of Explanation of Code

Set WshShell = WScript.CreateObject("WScript.Shell")

msgbox "Press 'OK' to test whether your computer is on." ,32, "Test"

msgbox "Yes, your computer is on." , 64, "Result"

Line 1 of the code imports the "WshShell", which would come in handy if you wanted to do something like " WshShell.Run "chrome.exe" ". What this code would do is open up Google Chrome, which could come in useful later if you wanted the program to open a browser. Line 2 of the code creates a new message box, that says "Press 'OK' to test whether your computer is on." with a header that says "Test". The 32 means that the icon that will display on the side is the "Question mark" icon, since 32 is its number code. Finally, Line 3 of the code tells the user, with a message box, that their computer is, in fact, on (!) , with the header "result" and the icon code 64, which is an info box.

Step 4: You Finished!

Picture of You Finished!

Now, whenever you want to check whether your computer is turned on, simply launch this questionnaire and it'll tell you. Thanks for reading! I even attached a copy of the code for your convenience.

Step 5: Other Stuff

Picture of Other Stuff

If you want to learn more vbscript, look it up on the internet. If I am not mistaken, there are also a fair amount of .vbs instructables out there. VBScript is pretty useful for making small programs, and it is easy to use.

Comments

Swansong (author)2017-03-10

Thanks for sharing :)

About This Instructable

58views

3favorites

License:

More by hudmarc:Helpful Code for Beginning Computer Users.
Add instructable to: