VBS Commands

I want to know some more vbs commands. Please don't give me links to w3schools.com I've read all those I mean code chunks like these

dim variable

0 - ok button only
1 - ok and cancel
2 - abort, retry and ignore
3 - yes no and cancel
4 - yes and no
5 - retry and cancel
16 - critical message icon
32 - warning icon
48 - warning message
64 - info message
0 = vbDefaultButton1 - First button is default
256 = vbDefaultButton2 - Second button is default
512 = vbDefaultButton3 - Third button is default
768 = vbDefaultButton4 - Fourth button is default
4096 = System modal, alert will by on top of all aplications

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
Sapi.speak "text here"
Sapi.speak variable

set wshshell = wscript.CreateObject("wscript.shell")
wshshell.run "file.bat"
Wscript. sleep duration

object.sendkeys "keys"

name=msgbox ("Message",0+16,"Title")
name=inputbox ("Message",0+16,"Title")

end if

Picture of VBS Commands
caitlinsdad6 years ago
Those are not tricks. They are just proper use of knowing the correct syntax and parameters or properties of functions and keywords.
Super_Nerd (author)  caitlinsdad6 years ago
Well thats what I mean. I just call them tricks because I have never seen a command that does it all but these are small enugh to be implanted in a real program. I save these program bits in a small file. When I need to use the command I can just copy the example I put in the file and put them into my script. Basically it helps me remember how to do stuff I haven't done in a long time.
They are called subroutines/functions or chunks of code or fragments you can reuse commonly stored in a library. There is a saying "Don't synthesize. Plagiarize!"
Super_Nerd (author)  caitlinsdad6 years ago
Well thank you for telling me the real term. :) Do you have any code chunks that are interesting?