simpleshare-contextwindows/Freigabe-Launcher.cmd

24 lines
670 B
Batchfile

@echo off
setlocal EnableDelayedExpansion
REM DEBUG: Zeige was ankommt
echo Argument 1: %~1 > "%TEMP%\freigabe_debug.txt"
echo Argument 2: %~2 >> "%TEMP%\freigabe_debug.txt"
echo Argument 3: %~3 >> "%TEMP%\freigabe_debug.txt"
echo Argument 4: %~4 >> "%TEMP%\freigabe_debug.txt"
echo Alle Args: %* >> "%TEMP%\freigabe_debug.txt"
set "action=%~1"
set "filepath=%~2"
set "scriptdir=%~dp0"
if "%action%"=="add" (
set "script=%scriptdir%Freigabe-Hinzufuegen.ps1"
) else if "%action%"=="remove" (
set "script=%scriptdir%Freigabe-Entfernen.ps1"
) else (
exit /b 1
)
powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "%script%" -Path "%filepath%"