Virtual Work Periods and Emailing WP Report

Yeah your batch file is diff. Remove the quotes from your change directory command and script home location values.

@echo off
cls

set rSource=%1
set rTarget=%2

set gxpsLocation=C:\Program Files (x86)\SambaPOS5\Reports\gxps\

:: Delete previous rTarget
if exist %rTarget% del %rTarget%

C:
CD
CD %gxpsLocation%
gxpswin64.exe -sDEVICE=pdfwrite -sOutputFile=%rTarget% -dNOPAUSE %rSource%

It’s just so strange, I tried my best but could not find where the error is. It says the syntax of the command is incorrect.

image

image

When I remove this line:

if exist %rTarget% del %rTarget%

The batch file works. Do you know anything wrong with it?

And now, it works. So confusing, it did not work just few minutes ago.

image