@ECHO off set HUB=%1 set PROJECT_ID=%2 set NEW_NAME=%3 set PROJECT_HTML_URL=%HUB%/project/%PROJECT_ID%.html set CURL_CMD=curl :: The Project file has exactly one line containing substring :: 'old_name_hash', and the hash value is between the 7th and 8th :: (1-based) double quotes on that line. FOR /F delims^=^"^ tokens^=8 %%i IN ('%CURL_CMD% %PROJECT_HTML_URL% ^| findstr -r "old_name_hash" 2^>nul') DO set OLD_NAME_HASH=%%i (%CURL_CMD% -d old_name_hash=%OLD_NAME_HASH% -d new_name=%NEW_NAME% %PROJECT_HTML_URL%) exit /b