Passing path from batch file to mysql
MySQL's source command executes the file as a separate process.  By design, it executes in a different session than the one where you assigned the variable.  You should find that executing set @2:='%scriptpath%'; source DBQuery1.sql; from within a mysql.exe session also does not work, either, although I haven't tested this myself recently.

As a workaround, you can write your script to automatically generate the SQL script file each time the file is run:

set MUSER=root 
set MPASS=xprd123 
set MHOST=172.33.49.55 
set DB=DBName1
set MBIN=C:\Program Files\MySQL\MySQL Server 5.5\bin
set scriptpath=D:\STATS_COLLECTOR\
set scriptfile=D:\STATS_COLLECTOR\DBQuery1.sql

echo SELECT 'INNODB_OS_LOG_WRITTEN','QUESTIONS' &gt; %scriptfile%
echo UNION &gt;&gt; %scriptfile%
echo SELECT &gt;&gt; %scriptfile%
echo MAX(IF(variable_name = 'INNODB_OS_LOG_WRITTEN', VARIABLE_VALUE, NULL)) AS INNODB_OS_LOG_WRITTEN, &gt;&gt; %scriptfile%
echo MAX(IF(variable_name = 'QUESTIONS', VARIABLE_VALUE, NULL)) AS QUESTIONS &gt;&gt; %scriptfile%
echo FROM information_schema.GLOBAL_STATUS &gt;&gt; %scriptfile%
echo INTO OUTFILE '%scriptpath%/stats.csv' &gt;&gt; %scriptfile%
echo     FIELDS TERMINATED BY ',' &gt;&gt; %scriptfile%
echo     ENCLOSED BY '"' &gt;&gt; %scriptfile%
echo     LINES TERMINATED BY '\n' &gt;&gt; %scriptfile%
echo ; &gt;&gt; %scriptfile%

"%MBIN%\mysql.exe" -u"%MUSER%" -p"%MPASS%" -h "%MHOST%" "%DB%" &lt; %scriptfile%


Another alternative is to write the query in a more versatile scripting language such as PowerShell, which would allow you to use the MySQL Connector/Net API to execute any arbitrary set of queries you wanted.