VBS Script beispiel mit Parameter
Posted On 2. Januar 2011
' *****************************************************************
' * Autor: Buanet Production's
' * Version: 1.0
' * Date: 27.09.2008
' * Desc: Argumente an vbs übergeben.
' *****************************************************************
If wscript.arguments.count = 0 Then
wscript.echo "Es wurden kein oder kein gültiges Argumente übergeben! "
wscript.quit
End If
arg0 = wscript.arguments.unnamed.item("0")
If wscript.arguments.count = 1 Then
wscript.echo "Es wurde ein Argumente übergeben! "
If arg0 = "start" Then
wscript.echo "Starte Funktion Start"
Start()
End If
If arg0 = "stop" Then
wscript.echo "Starte Funiton Stop"
Stopp()
End If
wscript.quit
End If
Function Start()
wscript.echo "Funktion Start"
End Function
Function Stopp()
wscript.echo "Funktion Stop"
End Function
' ** BENANNTE Argumente welche mit /xy-argument: angegeben werden. **
'If wscript.arguments.named.exists("start") Then
' wscript.echo "Start wurde übergeben.."
'End If
'If wscript.arguments.named.exists("stop") Then
' wscript.echo "Stop wurde übergeben.."
'End If