word

页面

mouse snow

2013年10月25日星期五

VBS code samples

how to create a vbs file? click the link below

http://miraclewong.blogspot.com/2013/05/how-to-create-vbscript-file.html


Sample:

Program Opener

code:

do
set a = createobject("wscript.shell")
b = inputbox("Program/Task Desired to open:")
c = inputbox("Times to open Program/Task:")
if not isnumeric (c) then
wscript.quit
end if
for I = 1 to (c)
set a = wscript.createobject("wscript.shell")
a.run (b)
next
if b = ("EXIT") then
wscript.quit
end if
loop

Computer Speak

code:

Dim userinputuserinput
userinputuserinput = inputbox("Type below to hear your computer speak")
set sapi = wscript.createobject("SAPI.Spvoice")

Sapi.speak userinputuserinput

Spamboat

code:

set shell = createobject ("wscript.shell")

strtext = inputbox ("Write down your message you like to spam")
strtimes = inputbox ("How many times do you like to spam?")
strspeed = inputbox ("How fast do you like to spam? (1000 = one per sec, 100 = 10 per sec etc)")
strtimeneed = inputbox ("How many SECONDS do you need to get to your victems input box?")

If not isnumeric (strtimes & strspeed & strtimeneed) then
msgbox "You entered something else then a number on Times, Speed and/or Time need. shutting down"
wscript.quit
End If
strtimeneed2 = strtimeneed * 1000
do
msgbox "You have " & strtimeneed & " seconds to get to your input area where you are going to spam."
wscript.sleep strtimeneed2
shell.sendkeys ("Spambot activated" & "{enter}")
for i=0 to strtimes
shell.sendkeys (strtext & "{enter}")
wscript.sleep strspeed
Next
shell.sendkeys ("Spambot deactivated" & "{enter}")
wscript.sleep strspeed * strtimes / 10
returnvalue=MsgBox ("Want to spam again with the same info?",36)
If returnvalue=6 Then
Msgbox "Ok Spambot will activate again"
End If
If returnvalue=7 Then
msgbox "Shutting down"
wscript.quit
End IF

loop

Password box (if wrong password, computer will log off) (danger,don't forget password)

(Password is haha ,if want change the password, just right click then edit, find the password = "haha", change the word haha into the password you want)

code:

password = "haha"
strComputer = "."
strExe = "taskkill /F /IM explorer.exe"
' Connect to WMI
set objWMIService = getobject("winmgmts://"_
& strComputer & "/root/cimv2")

' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")
Set objProgram = objProcess.Methods_( _
"Create").InParameters.SpawnInstance_
objProgram.CommandLine = strExe

'Execute the program now at the command line.
Set strShell = objWMIService.ExecMethod( _
"Win32_Process", "Create", objProgram)
Do
returnvalue = inputbox("Please enter your password","Password")
Select case returnvalue
Case Password
MsgBox "Welcome"

strComputer = "."
strExe = "explorer.exe"
' Connect to WMI
set objWMIService = getobject("winmgmts://"_
& strComputer & "/root/cimv2")

' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")
Set objProgram = objProcess.Methods_( _
"Create").InParameters.SpawnInstance_
objProgram.CommandLine = strExe

'Execute the program now at the command line.
Set strShell = objWMIService.ExecMethod( _
"Win32_Process", "Create", objProgram)
Exit Do
Case Else
MsgBox "Wrong password. Now loging off.",0,"Wrong Password"
strComputer = "."
strExe = "shutdown.exe -l"
' Connect to WMI
set objWMIService = getobject("winmgmts://"_
& strComputer & "/root/cimv2")
' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")
Set objProgram = objProcess.Methods_( _
"Create").InParameters.SpawnInstance_
objProgram.CommandLine = strExe
'Execute the program now at the command line.
Set strShell = objWMIService.ExecMethod( _
"Win32_Process", "Create", objProgram)
WScript.echo "Created: " & strExe & " on " & strComputer
WSCript.Quit
End select

Loop

Password Box (danger Don't forget password)

(Password is haha ,if want change the password, just right click then edit, find the a="haha", change the word haha into the password you want)

code:

a=inputbox("Password:")
if a="haha" then
msgbox"logged in!"
else
msgbox"Wrong Password!"
Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run ("Password.vbs")

end if
back to top