CODE: [Copy to clipboard]@echo off if [%1]==[:] goto %2 call %0 : catchvar %m% echo %m% to %new% goto end :catchvar if [%3]==[] goto end set new=%new%%3 shift goto catchvar :end