29 maj 2008

Uruchomienie i zamknięcie notatnika, notepad

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("Notepad")
Wscript.Sleep 3000

WshShell.AppActivate("Bez tytułu - Notepad")
WshShell.SendKeys("Dodanie tekstu po 3 sekundach")
WScript.Sleep 3000
WshShell.SendKeys "%{F4}"
Set WshShell = Nothing
WScript.Quit 0
29 maj 2008

Uruchomienie kliku aplikacji

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

'Launch a couple of applications
WshShell.Run "NOTEPAD.EXE", 1, False
WshShell.Run "CALC.EXE", 1, False
WshShell.Run "WORDPAD.EXE", 1, False
29 maj 2008

Wykonanie operacji matematycznych w kalkulatorze

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run( "calc")
Wscript.Sleep (100)
WshShell.AppActivate( "Calculator")
Wscript.Sleep (100)
WshShell.SendKeys( "1{+}")
Wscript.Sleep (500)
WshShell.SendKeys ("2")
Wscript.Sleep (500)
WshShell.SendKeys( "=")
Wscript.Sleep (500)
WshShell.SendKeys( "*4" )
Wscript.Sleep (500)
WshShell.SendKeys( "=" )
' 1+2 = 3  * 4 = 12
29 maj 2008

Dodanie tekstu do notatnika, notepad

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run("Notepad")
Wscript.Sleep 3000
WshShell.AppActivate("Bez tytułu - Notepad")
WshShell.SendKeys("Dodanie tekstu po 3 sekundach")
29 maj 2008

Wygenerowanie skryptu VirtualDub z lista plików avi do polączenia

Wygenerowanie skryptu VirtualDub z lista plików avi do polączenia

Set MyFiles = CreateObject("Scripting.FileSystemObject")
Set Folder = MyFiles.GetFolder(dir)
licznik = 0
Set WszystkiePliki = Folder.Files
For Each X in WszystkiePliki
plik = X.Path
line = scriptVCF & plik
if licznik = 0 Then
line = " VirtualDub.Open(" & Chr(34) & Replace(plik, "\", "\\") & Chr(34) & ");"
else
line = " VirtualDub.Append(" & Chr(34) & Replace(plik, "\", "\\") & Chr(34) & ");"
end if
scriptVCF = scriptVCF & line & vbNewLine
licznik = licznik + 1
Next