Skip to content

Instantly share code, notes, and snippets.

@Andrewsville
Created June 13, 2011 08:36
Show Gist options
  • Select an option

  • Save Andrewsville/1022468 to your computer and use it in GitHub Desktop.

Select an option

Save Andrewsville/1022468 to your computer and use it in GitHub Desktop.
Run PHP in each subdirectory with given options
@echo off
SETLOCAL ENABLEEXTENSIONS
REM CALL :process FOR ALL FOUND DIRECTORIES
FOR /D %%a IN (*) DO (
SET version=%%a
CALL :process %*
)
ENDLOCAL
GOTO :eof
:process
REM OUTPUT PHP VERSION
FOR /F "delims=" %%a IN ('CALL %CD%\%version%\php.exe -v') DO (
ECHO %%a
GOTO :call
)
REM RUN THE ACTUAL COMMAND
:call
CALL %CD%\%version%\php.exe %*
GOTO :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment