Helpful Code for Beginning Computer Users.

by hudmarc in Circuits > Assistive Tech

515 Views, 3 Favorites, 0 Comments

Helpful Code for Beginning Computer Users.

msgbox.png

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

Open Notepad

Notepad.png

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"

Compilling

ansi.png
WRONG.png

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.

Explanation of Code

msgbox.png

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.

You Finished!

vbscript.png
text.png

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.

Downloads

Other Stuff

vbscript.png

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.