Try this batch code:
@echo off
if "%~1" == "" goto :EOF
for %%I in ("%~1\*.tex") do C:\python27\python.exe "%~dp0tools\textool.py" -x -v -ra "%%~fI"
The batch file does nothing if called without a parameter.
But in case of batch file is called with a parameter, it expects without verification (could be added) that the (first) parameter specifies a folder path in which all *.tex files should be processed by the Python script.
An alternate solution:
@echo off
if "%~1" == "" goto :EOF
pushd "%~1"
if errorlevel 1 goto :EOF
for %%I in ("*.tex") do C:\python27\python.exe "%~dp0tools\textool.py" -x -v -ra "%%~nxI"
popd
The directory specified as parameter becomes the current working directory for this batch file and the Python script gets just file name with file extension passed via command line parameter.
For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.
call /?
... explains:
%~1
... first parameter without surrounding double quotes
%~dp0
... drive and path of argument 0 which is path of folder containing the batch file ending with a backslash.
echo /?
for /?
goto /?
if /?
popd /?
pushd /?
Note: It would be much faster to modify the Python script to search itself for all *.tex files in folder path specified on command line as parameter for conversion of each found file matching the pattern to a *.png file.