SNAP seems to ignore outputfile from command line

I start wondering if SNAP does not take the outputfile from command line, all attempts to hand an outputfilename to the xml file fail, except when having the filename hardcoded in the xml file. Cases here ( i tried more than these):

Case 1 works when the outputfile is hardcoded in the xml file:

  <node id="Write">
    <operator>Write</operator>
    <sources>
      <sourceProduct refid="Reproject"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>c:temp/test.dim</file>
      <formatName>BEAM-DIMAP</formatName>
    </parameters>
  </node>

Case 2: Using this command:

gpt C:\Users\Calib_Spk_reproj_LinDB_Barents.xml ' -Pfile="c:/rs2/product.xml"  -Ptarget="c:/temp/test.dim"

having this written in my xml file:

  <node id="Write">
    <operator>Write</operator>
    <sources>
      <sourceProduct refid="Reproject"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>$target</file>
      <formatName>BEAM-DIMAP</formatName>
    </parameters>
  </node>

gives this error: Error: Not able to write product file: ‘C:\Program Files\snap\target.dim’

Case 3: trying this command

gpt C:\Users\Calib_Spk_reproj_LinDB_Barents.xml ’ -Pfile=“c:/rs2/product.xml” -t “c:/temp/test.dim”

with any version of my xml file gives this error Error: Not able to write product file: ‘C:\Program Files\snap\target.dim’

Case 4: This version works still fine using Nest 5.1
command:

gpt C:\Users\Calib_Spk_reproj_LinDB_Barents.xml ' -Pfile="c:/rs2/product.xml"  -Tfile="c:/temp/test.dim"

with this xml

  <node id="Write">
    <operator>Write</operator>
    <sources>
      <sourceProduct refid="Reproject"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>$target</file>
      <formatName>BEAM-DIMAP</formatName>
    </parameters>
  </node>