Seu objetivo é bem formulado, então por que você não o transforma em comandos em lote ?
@ECHO OFF >NUL
@SETLOCAL enableextensions enabledelayedexpansion
rem For all files with DSW xtension
FOR %%f IN (*VU*.dsw) DO (
rem get my filename: no path, no file extension
set "filename=%%~nf"
rem initialize variables
set "variable1=var1"
set "variable2=var2"
rem If my filename contains VU1 so variable1=2 and variable2=2
If not "!filename:VU1=!"=="!filename!" (
set "variable1=2"
set "variable2=2"
)
rem If my filename contains VU2 so variable1=20 and variable2=30
If not "!filename:VU2=!"=="!filename!" (
set "variable1=20"
set "variable2=30"
)
rem display result
echo %%f "!filename!" !variable1! !variable2!
)
rem end
ENDLOCAL
goto :eof