Windows Batch help in setting a variable from command output [duplicate]

I just find out how to use commands with pipes in it, here’s my command (that extracts the head revision of an svn repo) :

SET SVN_INFO_CMD=svn info http://mySvnRepo/MyProjects
FOR /f "tokens=1 delims=" %%i IN ('%SVN_INFO_CMD% ^| find "Revision"') DO echo %%i

Leave a Comment