• Log in or sign up for an account here: https://www.sythe.org/login

Guide to VBScripting with Notepad (Make Pop-ups, etc)

Nyx

SMR likes me a lot

Banned
Joined
Dec 17, 2010
Sythe Gold
0
Messages
480
Location
Belgium
Guide to VBScripting with Notepad​

Table of content
  • A brief introduction
  • Getting started
  • The icons
  • Questions
  • Funny codes
  • Afterword

A brief introduction

I'm sure you all are familiar with this: You try to run a program, and a window with an error message pops up! Unfortunately, I am not going to explain you how to fix these problems. This guide is about how you can make your own Pop-ups. Enjoy!

Getting started

You don't have to install anything, all you need is the Notepad.
Let's start with some simple examples: Open Notepad, and write msgbox "test". (You can replace the "test" with anything.)
Save the file as test.vbs, and choose 'Desktop' as location. Hit the 'Save' button (Save the file under 'all files'!), and open the file on your desktop.

guidepic1.png


Then something like this should pop up:

guidepic2.png


Note: To change the Msgbox:
  • Right Mousbutton → Edit
  • Right Mousebutton → Open with: Notepad

Icons

Now we are going to add an icon and a title to the pop-up. Open a new Notepad, (or edit your previous one) and write: "test", 16, "title" (You can replace the words between the "" with anything.)
Once again, save it as 'All Files', on your Desktop and don't forget to name it anything.vbs!

Open it, and you should see something like this:

guidepic3.png


The 16 represents the red warning sign. Here are a few numbers you can replace it with:

  • 32: Question mark
  • 48: Yellow triangle with a black exclamation mark
  • 68: Blue circle with an I(nformation)
  • 4096: The Pop-up stays on the foreground

Questions
a) Ask a question

Open a new Notepad and write this:

Code:
a=inputbox("What is your name?")
msgbox "You have a nice name, "+a

(You can replace the words between the "" with anything.)
Once again, save it as 'All Files', on your Desktop and don't forget to name it anything.vbs!

Result:
guidepic4.png

guidepic5.png


b) Polar questions (yes/no questions)

Open a new notepad and write this:

Code:
if msgBox("Would you donate money to Unicef?", vbYesNo, "Question") = vbYes then
msgbox "That's very kind of you."
else
msgbox "Okay, it's YOUR money..."
end if

(You can replace the words between the "" with anything.)
Once again, save it as 'All Files', on your Desktop and don't forget to name it anything.vbs!

Then you should see something like this:
guidepic6.png


And so on.

Funny codes

A beep

The following code will activate a short 'beep'. (Speakers must be on)

Code:
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True

Infinite beeps (Read how to stop the script first, at the end of the guide)

Code:
do
Set oWS = WScript.CreateObject("WScript.Shell")
oWS.Run "%comspec% /c echo " & Chr(07), 0, True
loop

Your computer can speak!

Code:
Set vo = CreateObject("SAPI.SpVoice")
vo.speak "Hello"
(You can replace the "hello" with anything)

Change your MSN name

Code:
Set WshShell = CreateObject("Wscript.shell") 
WshShell.Run ("msnmsgr.exe") 
Wscript.Sleep 1200 
WshShell.sendkeys "%x" 
WshShell.sendkeys "O" 
WshShell.sendkeys "(Enter MSN name here)"

Computer Disco

The following code makes your computer Caps Lock light flashing on/out.

Code:
Set wshShell =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
loop

Windows Wizard!

Code:
On Error Resume Next
StrAgentName2 = "MERLIN"
StrAgentPath2 = "C:\Windows\Msagent\Chars\" & strAgentName2 & ".Acs"
Set objAgent2 = CreateObject("Agent.Control.2")
ObjAgent2.Connected = TRUE
ObjAgent2.Characters.Load strAgentName2, strAgentPath2
Set objPeter = objAgent2.Characters.Character(strAgentName2)
ObjPeter.MoveTo 700,300
ObjPeter.Show
ObjPeter.Play "GetAttention"
ObjPeter.Play "GetAttentionReturn"
ObjPeter.Speak("Hello, I'm a wizard.")
wscript.sleep 10000
(You can replace the "Hello, I'm a wizard" with anything)

Infinite message (Read how to stop the script first)

Code:
do 
msgbox"You can't stop me" 
loop
(You can replace the "You can't stop me" with anything.)

Shut down your computer (There is no way back, so make sure all your work is saved!)

Code:
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.ShutDown()
next

Important: How to stop the script:
  1. Control+Alt+Delete
  2. Task Manager
  3. Processes
  4. Search for Wscript.exe and end the process

Afterword

I spend quite a lot of time writing this guide, but I'm glad I did it. I would like to see some honest feedback from you, so please don't hestitate to tell me how to improve. If you have any questions, please feel free to PM me and I will get back to you as soon as possible. Thanks for reading and I hope I helped you!
 
Le Monkey
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
This has to be one of the best UE guides ever.
 
Can you re-upload pictures? Thanks.
 
Heidy
OG Club
Brony
Penguin
MushyMuncher
Doge
Bitch!
Cook
DIAF
Spyro
Pokémon Trainer
<3 n4n0
Gohan has AIDS
Le Monkey
Shitting Rainbow
Extreme Homosex
In Memory of Jon
Lawrence
Poker Chip
Potamus
This is actually a really good guide. Tried it out and worked, thanks alot :)
 
Le Monkey
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
It's been a while since we've had new helpful, contributing programmers :)

Keep up the great work.
 
Great guide :) I profer to use Notepad++ it is so much cleaner, cheak it out.

Thanks & I'll defintely check that out!

This is actually a really good guide. Tried it out and worked, thanks alot :)

Thanks, glad you liked it!

It's been a while since we've had new helpful, contributing programmers :)

Keep up the great work.

Thanks again, SMR :)

thx very much m8 !!~~!!

No problem!
 
Bump! :)
 
Runescape Gamblingrunescape gambling
Back
Top