Please contribute any VBS scripts you've found that work
Quite a few can be found here
Posted 29 September 2003 - 09:01 AM
Posted 29 September 2003 - 11:48 AM
set WshShell = WScript.CreateObject("WScript.Shell")
Wscript.Sleep 9000
WshShell.SendKeys "{DOWN}"
Wscript.Sleep 100
WshShell.SendKeys "{DOWN}"
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 2000
WshShell.SendKeys "{LEFT}"
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys " "
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{DOWN}"
Wscript.Sleep 100
WshShell.SendKeys " "
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{UP}"
Wscript.Sleep 100
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys " "
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys " "
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys "{TAB}"
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 9000
WshShell.SendKeys "{RIGHT}"
Wscript.Sleep 100
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 2000
WScript.Quit
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 1500
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WScript.Quit
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 3500
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys " "
WScript.Sleep 100
WshShell.SendKeys "{TAB}"
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 600
WshShell.SendKeys "{ENTER}"
WScript.Sleep 3500
WshShell.SendKeys "%{F4}"
WScript.Quit
Posted 30 September 2003 - 06:10 AM
Option Explicit
'to wait for the window "Setup Finish" to appare and press Alt n
'!NOTE! if there are more then one window with the same name it will not work, it will need more work!
dim WshShell, iLoopTimeWait
Set WshShell = WScript.CreateObject("WScript.Shell")
iLoopTimeWait = 500
Call Main()
Set WshShell = Nothing
Sub Main()
Connect2Window iLoopTimeWait, "Setup Finish"
WshShell.SendKeys "%n"
End Sub
Function Connect2Window(iTime, sWindowName)
Do until WshShell.AppActivate (sWindowName)
WScript.Sleep iTime
loop
End function
Posted 30 September 2003 - 04:45 PM
Posted 30 September 2003 - 04:49 PM
Posted 30 September 2003 - 04:59 PM
Posted 01 October 2003 - 07:39 AM
Posted 05 October 2003 - 10:34 AM
On Error Resume Next
'Declare var's and objects
Dim WshS, fso, wi, sysr, sysd, home, aup, cpf, pf, up, upr, app, tool, Stpr, sys32, dllc, f1, t0, t1 ,t2, t5, t7, t10, t15, t30, Btn, i, wmi, os, objset
Set WshS = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
'Expand Environment
'Create const's to spare time and place
sysr = WshS.ExpandEnvironmentStrings("%SystemRoot%")
sysd = WshS.ExpandEnvironmentStrings("%Systemdrive%")
home = WshS.ExpandEnvironmentStrings("%Homepath%")
aup = WshS.ExpandEnvironmentStrings("%AllUsersProfile%")
cpf = WshS.ExpandEnvironmentStrings("%CommonProgramfiles%")
pf = WshS.ExpandEnvironmentStrings("%Programfiles%")
up = WshS.ExpandEnvironmentStrings("%UserProfile%")
'WARNING: I use a "\" at the end.
'The above const's DON'T have a "\" at the end !
app = sysd & "\APPLICATIONS\"
sys32 = sysr & "\System32\"
dllc = sys32 & "\dllcache\"
Stpr = aup & "\Startmenu\Programs\"
'Upr-->%UserProfile%\Startmenu\Programs\
Upr = up & "\Startmenu\Programs\"
'Create a log-file
Set f1 = fso.CreateTextFile(sysd & "\install.log", True)
'Write a line to the log
f1.WriteLine "Begin Installation"
'I don't explain it;-)
f1.WriteBlankLines(1)
'Create const's for use in the script
wi = " is installed"
'Time const's for sleep
t0 = 500
t1 = 1000
t2 = 2000
t5 = 5000
t7 = 7000
t10 = 10000
t15 = 15000
t30 = 30000
'Make some optional components visible for (de)installation
WshS.Run "notepad.exe %systemroot%\inf\sysoc.inf"
WinDo = "sysoc.inf - Editor"
Call SendK("%{e}")
'I think in english is r-->replace
WshS.SendKeys "r"
Wscript.Sleep t1
WshS.SendKeys ",hide,"
WshS.SendKeys "{TAB}"
WshS.SendKeys ",,"
WshS.SendKeys "{TAB 4}"
WshS.SendKeys "~"
WshS.SendKeys "{TAB}"
WshS.SendKeys "~"
Wscript.Sleep t1
WshS.SendKeys "%{F4}"
WinDo = "Editor"
Call SendK("~")
'Show me a box for 2 sec.
WshS.Popup "Create TEMP-Folder",2
'Create Temp-folder
'I set all Temp-folders in the registry to %systemdrive%/Temp,
'cause i hate three or more temp-folders in the 2nd subdir
fso.CreateFolder(sysd & "\Temp")
f1.WriteLine "TEMP-Folder" & wi
'Packets to extract
WshS.Run app & "DirectX9b.exe", 0, true
'true --> same as /wait in batch
'0 --> hide window
'Delete what you (don't) want
fso.DeleteFile(dllc & "scrnsave.scr"), true
'true means--> DO IT!
'Move and copy what you want
fso.MoveFile dllc & "uxtheme.dll", dllc & "uxtheme.old"
fso.MoveFile sys32 & "uxtheme.dll", sys32 & "uxtheme.old"
fso.CopyFile app & "uxtheme.dll", dllc
fso.CopyFile app & "uxtheme.dll", sys32
'Install what you want
WshS.Run "REGEDIT /S " app & "reg.reg", 0, false
fso.CopyFile app & "directx.cpl", sys32 & "\"
f1.WriteBlankLines(1)
f1.WriteLine "Programs and files registered and copied "
WshS.Popup "Install programs",2, StrT,64
'For example
WshS.Run app & "Java141\setup.exe -s -f1" & Chr(34) & app & "Java141\setup.iss" & Chr(34), 0, true
f1.WriteLine "SUN-Java" & wi
WshS.Run app & "MsnMsgs.msi /QB", 0, true
WshS.Run app & "MsgPlus.exe /SilentInstallNoSponsor", 0, true
f1.WriteLine "Messenger 6 und Plus" & wi
'Thank you beep;-)
WinDo = "Internet Explorer"
Call SendK("%{F4}")
WinDo = "MSN Messenger"
Call SendK("%{F4}")
'Install your programs here or anywhere
'Install DX9b
WshS.Run app & "DirectX9b\dxsetup.exe /windowsupdate", 0, true
'You can simple check for execution, but this is a lot of work
If fso.FileExists(sysr & "\directx.log") Then
f1.WriteLine "DirectX9b" & wi
Else
f1.WriteLine " DirectX9b NOT installed "
End If
f1.WriteBlankLines(1)
WshS.Run app & "xp-AntiSpy.exe 0 1 2 3 4 5 6 7 8 9 10 11 12 14 16 19 20 21 22 24 25 26 27 29 30 31 32"
fso.DeleteFolder(Stpr & "PrintM~1"), true
fso.DeleteFile(upr & "Remote~1.lnk"), true
'Delete PrintMe- thing
fso.DeleteFolder(pf & "\Adobe\Acrobat 6.0\Reader\plug_ins\Printme"), true
fso.DeleteFile(pf & "\Adobe\Acrobat 6.0\Reader\plug_ins\Printme.*"), true
f1.WriteLine "Stupid things deleted "
fso.DeleteFolder(sysd & "\Applications"), true
fso.DeleteFile(sysr & "\deluser.exe"), true
'Close the log
f1.Close
'empty Tempfolder
fso.DeleteFile(sysd & "\Temp\*.*"), true
'delete tmp-files in windir
fso.DeleteFile(sysr & "*.tmp"), true
'Shutdown in 10 sec. If you press 'Yes', immediatly.
Btn = WshS.Popup ("System-Shutdown in 10 sec. !",10," - Shutdown - ",36)
If Btn = 7 Then Wscript.Quit
Set wmi = GetObject("winmgmts:{(Shutdown)}")
Set objset = wmi.instancesof("win32_operatingsystem")
For each obj in objset
Set os = obj : exit For
Next
fso.DeleteFile(sysd & "\install.vbs"), true
'Delete this script
os.shutdown
Wscript.Quit
Sub SendK(Skey)
Connect2Window t0, WinDo
WshS.SendKeys Skey
End Sub
Function Connect2Window(iTime, sWindowName)
i = 1
Do until WshS.AppActivate (sWindowName)
i = i + 1
WScript.Sleep iTime
'wait max. 40 x t0 ~ 20 sec.
If i = 40 Then Exit Function
loop
End Function
Posted 08 October 2003 - 02:27 AM
Quote
Posted 08 October 2003 - 02:32 AM
Quote
Posted 13 October 2003 - 06:20 PM
'DivX 5.1 Pro Adware
'Script Created by Puru Oct 13, 2003
Dim WshShell, fso, temp, sysd, app, t0, reg, i, WinDo
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
temp = WshShell.ExpandEnvironmentStrings("%TEMP%")
sysd = WshShell.ExpandEnvironmentStrings("%Systemdrive%")
app = sysd & "\install\Applications\DivXPro\"
reg = app & "gator.reg"
t0 = 500
On Error Resume Next
WshShell.Popup "Do NOT MOVE the mouse an do NOT PRESS any button!",5," - Warning - ",48
WshShell.Run (app & "DivXPro51GAINBundle.exe")
'Increase this value if you have a slower harddisk
WScript.Sleep 5000
'DivX Pro(tm) Codec Adware Setup
WshShell.SendKeys "n"
WScript.Sleep 200
'Welcome
WshShell.SendKeys "n"
WScript.Sleep 200
'Choose Destination Location
WshShell.SendKeys "n"
WScript.Sleep 200
'Select Components
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys " "
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys " "
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "n"
WScript.Sleep 200
'Ready to Install
WshShell.SendKeys "n"
WScript.Sleep 200
'Gain Installation
WshShell.SendKeys "n"
WScript.Sleep 200
'DiVX License Agreement
WshShell.SendKeys "{ENTER}"
WScript.Sleep 200
'The Gator Corporation Privacy Statement
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 200
'The Gator Corporation License Agreement
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
'Wait for Installation to Finish
WinDo="Finished"
Call SendK("{Enter}")
WSCRipt.Sleep t0
'Close Window
WinDo = "DivX Pro Codec Adware"
Call SendK("%{F4}")
'Kill the gain process
WshShell.Run ("PSKill gain_3202")
WScript.Sleep 200
'Delete the executables
fso.DeleteFile(temp & "\~vis0000\gain_3202.exe"), true
fso.DeleteFolder(temp & "\~vis0000"), true
WScript.Sleep 200
'Remove Adware Registry Keys
WshShell.Run "REGEDIT /S " & reg, 0, false
Sub SendK(Skey)
Connect2Window t0, WinDo
WshShell.SendKeys Skey
End Sub
Function Connect2Window(iTime, sWindowName)
i = 1
Do until WshShell.AppActivate (sWindowName)
i = i + 1
WScript.Sleep iTime
'wait max. 40 x t0 ~ 20 sec.
If i = 40 Then Exit Function
loop
End Function
Wscript.Quit
Windows Registry Editor Version 5.00 [-HKEY_LOCAL_MACHINE\SOFTWARE\Gator.com] [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] "Trickler"=-
Posted 14 October 2003 - 06:38 PM
Set WshShell = WScript.CreateObject("WScript.Shell")
'uruchomienie instalacji
WshShell.Run app & "tc11.exe"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "%e"
WScript.Sleep 500
WScript.Quit
Set WshShell = WScript.CreateObject("WScript.Shell")
'uruchomienie instalacji
WshShell.Run app & "absetup.exe"
WScript.Sleep 2500
WshShell.SendKeys "N"
WScript.Sleep 500
WshShell.SendKeys "%A"
WScript.Sleep 500
WshShell.SendKeys "N"
WScript.Sleep 500
'odznaczanie menu w starcie
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ }"
WshShell.SendKeys "N"
WScript.Sleep 500
'odznaczenie skrotow
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ }"
WshShell.SendKeys "I"
'start kopiowania
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ }"
WshShell.SendKeys "F"
WScript.Sleep 500
WScript.Quit
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
'uruchomienie instalacji
WshShell.Run app & "airoboform.exe"
WScript.Sleep 2500
WshShell.SendKeys "%A"
WScript.Sleep 500
WshShell.SendKeys "N"
WScript.Sleep 500
WshShell.SendKeys "M"
WScript.Sleep 500
WshShell.SendKeys "I"
WScript.Sleep 5000
WshShell.Run app & "pskill.exe RoboTaskBarIcon.exe", 1, true
WScript.Sleep 500
WshShell.Run app & "pskill.exe iexplorer.exe", 1, true
WScript.Sleep 500
WshShell.Run app & "REGEDIT /S airoboHCU.reg", 1, true
WScript.Sleep 500
fso.DeleteFolder(Stpr & "c:\MyRobo~1"), true
WScript.Quit
Posted 15 October 2003 - 09:52 AM
studguy1, on Oct 13 2003, 06:20 PM, said:
Posted 15 October 2003 - 10:27 AM
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\Imp", "C:\imp.htm", "REG_SZ"
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\MsnMsgr"
... Call ChCD(D:\) WshShell.Popup "CD is " & s ... Wscript.Quit Function ChCD(DriveN) Set d = fso.GetDrive(DriveN) If d.IsReady And d.DriveType = 4 And d.VolumeName = "XPBOOT" Then s = DriveN End Function
SendST(500,"~") ... Wscript.Quit Sub SendST(pause, key) WScript.Sleep pause WshShell.SendKeys key End Sub
Posted 18 October 2003 - 08:32 PM
Posted 19 October 2003 - 07:10 AM
Posted 19 October 2003 - 07:48 AM
Dim WSHShell, AutoIt
Set WSHShell = WScript.CreateObject("WScript.Shell")
'Register the dll
WSHShell.Run "regsrv32 /s \YourPath\AutoItx.dll"
Set AutoIt = WScript.CreateObject("AutoItX.Control")
AutoIt.BlockInput "on"
'Do things
.
.
.
Wscript.Quit
Posted 20 October 2003 - 05:40 AM
Posted 20 October 2003 - 05:56 AM