if %1. == . exit set PARAMS=file:///%1 :loop shift if %1. == . goto send set PARAMS=%PARAMS%,file:///%1 goto loop :send start thunderbird.exe -compose attachment='%PARAMS%'