Skriptdepot: Windows Scripting Host
Option Explicit
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName

Sleep (VBS):

WScript.Sleep Wartezeit in Millisekunden

Veraltet (WSHExtend.ocx muß installiert sein):
Set objWait = Wscript.CreateObject("WSHExtend.WinExt")
objWait:WSHWait Wartezeit in Millisekunden
Option Explicit
Dim MsgText

MsgText = time
WScript.Sleep 3000
MsgText = MsgText & vbNewLine & time
WScript.Echo MsgText
WScript.Quit

Verknüpfung erstellen (VBS):

Option Explicit
Dim objWshShell, objShortcut, strDesktop

Set objWshShell = WScript.CreateObject("Wscript.Shell")
  strDesktop = objWshShell.SpecialFolders("Desktop")

Set objShortcut = objWshShell.CreateShortcut(strDesktop & "\Notepad.lnk")
  objShortcut.TargetPath = "%SystemRoot%\system32\notepad.exe"
  objShortcut.WindowStyle = 1       '(1 = Normal Window ; 3 = Maximized ; 7 = Minimized)
  objShortcut.Hotkey = "Ctrl+Alt+E"
  objShortcut.IconLocation = "notepad.exe, 0"
  objShortcut.Description = "Shortcut to Notepad"
  objShortcut.WorkingDirectory = strDesktop
  ' objShortcut.Arguments = "C:\myFile.txt"
  objShortcut.Save

WScript.Echo objShortcut.FullName

MSDN SpecialFolders Property
MSDN CreateShortcut Method


Internet Explorer mit mehreren Seiten in Tabulatoren öffnen (ab IE 7):

Option explicit
Dim objIE, navOpenInBackgroundTab

Set objIE = WScript.CreateObject("InternetExplorer.Application")
navOpenInBackgroundTab = &h1000

With objIE
.Width = 750
.Height = 600
.Left = 100
.Top = 50
.visible = true
.Navigate2 "http://www.google.de"
.Navigate2 "http://www.lycos.de", navOpenInBackgroundTab
.Navigate2 "http://www.yahoo.de", navOpenInBackgroundTab
End With

Set objIE = nothing
navOpenInBackgroundTab = Null

blogs.msdn.com
Microsoft - Developer Network
Microsoft - Script Center


Total sinnloser Alarm:

Set WshShell = CreateObject("WScript.Shell")
For i = 1 to 12000
    For j = 1 to 50
        WshShell.SendKeys(chr(175))
    Next
    WshShell.SendKeys(chr(&hAD))
    For k = 1 to 3
        'WshShell.Run "%comspec% /c echo " & Chr(07), 0, True
        WScript.StdOut.Write(Chr(07))
        WScript.Sleep 200
    Next
    WScript.Sleep 500
Next

[http://www.nilpo.com/2008/11/windows-xp/mute-sound-volume-in-wsh/]


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License