Toad - Formatting with automation task

Hello,

I'm using an automation task to format the code from the command line and calling Toad like this way:

@echo off

rem first param is the sql filename without C: and the extension .sql
set SQL_FILENAME=%1
rem set SQL_FILENAME=%SQL_FILENAME:~3,-4%

rem get unique log filename
:uniqLoop
set "LOG_FILENAME=%tmp%\bat~%RANDOM%.tmp"
if exist "%LOG_FILENAME%" goto :uniqLoop

pushd "C:\Program Files\Quest Software\Toad for Oracle 16.0\"
Toad.exe -a PcsExtFormat
popd

type "%LOG_FILENAME%"
del "%LOG_FILENAME%"

Everything is working fine with Toad 2016. But If I try to use Toad 2017 (version 17.0.353.2906), the output is the same ending with a "Format successful" but the file is not formatted... If the sql file contains an error, the error is reported. It seems that the automation task is able to see the right file, but something is going wrong during the formatting process...

I can't upload an attachment, but if you let me I can maybe provide a little sample to show you the problème.

Thanks for your help.

regards,

Raphaël