Created
April 2, 2023 15:19
-
-
Save christian-korneck/e33badc798fa4e1fa7b242d6ab5d64ea to your computer and use it in GitHub Desktop.
batch file - execute the shell command received from stdin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
REM batch script that executes the command that it received via STDIN | |
REM (whitespaces should be working) | |
for /f "tokens=*" %%i in ('find /v ""') do set MYCMD=%%i | |
cmd.exe /c %MYCMD% | |
set myerrorlevel=%errorlevel% | |
exit /B %myerrorlevel% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment