25 lines
703 B
Plaintext
25 lines
703 B
Plaintext
' Launcher fuer Freigabe-Skripte
|
|
' Umgeht Probleme mit Sonderzeichen (& etc.) in Pfaden
|
|
|
|
Set objArgs = WScript.Arguments
|
|
If objArgs.Count < 2 Then
|
|
WScript.Quit 1
|
|
End If
|
|
|
|
strAction = objArgs(0)
|
|
strPath = objArgs(1)
|
|
|
|
Set objShell = CreateObject("WScript.Shell")
|
|
strScriptDir = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
|
|
|
|
If strAction = "add" Then
|
|
strScript = strScriptDir & "Freigabe-Hinzufuegen.ps1"
|
|
ElseIf strAction = "remove" Then
|
|
strScript = strScriptDir & "Freigabe-Entfernen.ps1"
|
|
Else
|
|
WScript.Quit 1
|
|
End If
|
|
|
|
strCommand = "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File """ & strScript & """ -Path """ & strPath & """"
|
|
objShell.Run strCommand, 0, False
|