echo wscript.echo dateadd("m", -1, date) >%tmp%\tmp.vbs
for /f "tokens=1,2,3 delims=/- " %%i in ('cscript /nologo %tmp%\tmp.vbs') do set TodayYear=%%i
for /f "tokens=1,2,3 delims=/- " %%i in ('cscript /nologo %tmp%\tmp.vbs') do set TodayMonthP0=%%j
for /f "tokens=1,2,3 delims=/- " %%i in ('cscript /nologo %tmp%\tmp.vbs') do set TodayDayP0=%%k

if %TodayMonthP0% LSS 9 set TodayMonthP0=0%TodayMonthP0%
if %TodayDayP0% LSS 9 set TodayDayP0=0%TodayDayP0%

IF %TodayMonthP0:~0,1% == 0 (
	SET /A TodayMonth=%TodayMonthP0:~1,1%+0
) ELSE (
	SET /A TodayMonth=TodayMonthP0+0
)

IF %TodayMonthP0:~0,1% == 0 (
	SET /A TodayDay=%TodayDayP0:~1,1%+0
) ELSE (
	SET /A TodayDay=TodayDayP0+0
)

%~d0
cd %~dp0

start %~d0\xampp\php\php.exe -f "%~dp0\HMI_Email_Sender.php" "Month_TGPF" "%TodayYear%-%TodayMonthP0%-01"
