Para esclarecer o objetivo, é criar uma matriz de comprimento n contendo uma lista de arquivos a serem compilados através do compilador google closure. Aqui está a solução rápida com um pouco de abstração:
@echo off
set projectDrive=E:
set js_folder=\myproject\trunk\htdocs\script
set deploy_folder=\myproject\trunk\deploy\script
::EnableDelayedExpansion is necessary to work with the array elements
::see link from Bradley Forney
setlocal EnableDelayedExpansion
REM start the command string with a reference to closure compiler
set command=java -jar E:\utils\compiler.jar
REM create whatever array elements you wish here
set __compile_array[0]=%js_folder%\com\mycompany\utils\Shim.js
set __compile_array[1]=%js_folder%\com\jquery\chosen.jquery.min.js
set __compile_array[2]=%js_folder%\com\jquery\jquery-cookie.js
::Get the array length
FOR /F "tokens=2* delims=[=]" %%a IN ('SET __compile_array') DO set /a length=length+1
::Adjust length to match zero based array index
set /a length=length-1
REM loop through array elements to create the command
for /l %%n in (0,1,%length%) do (set command=!command! --js !__compile_array[%%n]!)
write the command to the prompt with the addition of the output file
%command% --js_output_file "%deploy_folder%\main.js"