3 Useful VBScripts

Save with .vbs

Sends keystrokes of specified string (Appended with CrLf) a number of times:

dim shell
set shell=WSCript.CreateObject("Wscript.Shell")
If WScript.Arguments.Count<1 Then
a=inputbox("Text to spam:")
b=inputbox("Loop counter:")
spam b,a
Else
spam WScript.Arguments.Item(0),WScript.Arguments.Item(1)
End If
sub spam(x,y)
wscript.sleep(3000)
for i=1 to x
shell.sendkeys y & vbcr & vblf
next
end sub

Copies characters from their specified character values to the clipboard:

Dim shell
set shell=wscript.createobject("wscript.shell")
str=""
If wscript.Arguments.Count<1 Then
x=inputbox("Space Delimited list of character values to copy:")
list=split(x)
for each i in list
str = str & chr(i)
next
else
list=split(WScript.Arguments)
for each i in list
str = str & chr(i)
next
end if
shell.run "cmd.exe /c echo " & str & "|clip",0,false
wscript.quit

Runs a specified program as hidden:

Dim shell
set shell=wscript.createobject("wscript.shell")
If WScript.Arguments.Count>0 Then
shell.run WScript.Arguments.Item(0),0,false
Else
x=inputbox("Run hidden:")
shell.run x,0,false
End If
WScript.Quit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: