Using DOS format the following line in a windows batch file

set file=!file:~%len%!

gets set to 

set file=!file:~% class="re2">len%!

in the geshi output. Is there a workaround for this? Happens everywhere there's similar statements eg

set folder=!folder:~%len%!

if not !latest!==%~nx0 if not !latest!==%timestampfile% ( 
mkdir %tmp%!folder! & copy !file! %tmp%!folder!

All have html style fragments added after the %. I'm guessing it's a templating issue but I don't know enough about GeSHi to correct it. Originally found this in the wordpress plugin wp-syntax