For some reason I cannot get the cron.bat to work! Please help

Good Morning Folks,

I can’t seem to be able to get cron.bat to find my PHP.exe file and need some help making sure the cron.bat configuration is correct.

Current cron.bat contents:

cd /D C:\inetpub\wwwroot\SuiteCRM823\public\legacy
php.exe -f cron.php

Error when running it:

C:\inetpub\wwwroot\SuiteCRM823\public\legacy>cron.bat

C:\inetpub\wwwroot\SuiteCRM823\public\legacy>cd /D C:\inetpub\wwwroot\SuiteCRM823\public\legacy

C:\inetpub\wwwroot\SuiteCRM823\public\legacy>php.exe -f cron.php
‘php.exe’ is not recognized as an internal or external command,
operable program or batch file.

Actual Paths to files:

PHP.EXE: C:\inetpub\PHP
SuiteCRM Cron.php: C:\inetpub\wwwroot\SuiteCRM823\public\legacy

Can anyone help me code the cron.bat file correctly? I’ve tried numerous attempts with zero results. Thanks in advance!!

Have you included php folder in your path variables.?
If you haven’t please include it or use the complete path of php.exe in your .bat
In xampp the path of php is usually c:\xampp\php\php.exe

No, I didn’t. Thank you. The scheduler is working now. However, I’m getting a “Failure” on the check inbound email account job, but I’m not seeing anything in the logs. Anyone ever run into this?

It appears this comes up when the scheduler.bat is ran in the PHP error logs:

[08-Feb-2023 11:42:32 America/New_York] PHP Fatal error: Uncaught ValueError: imap_open(): Argument #4 ($flags) must be a bitmask of the OP_* constants, and CL_EXPUNGE in C:\inetpub\wwwroot\SuiteCRM-7.13.1\include\Imap\ImapHandler.php:294
Stack trace:
#0 C:\inetpub\wwwroot\SuiteCRM-7.13.1\include\Imap\ImapHandler.php(294): imap_open()
#1 C:\inetpub\wwwroot\SuiteCRM-7.13.1\modules\InboundEmail\InboundEmail.php(6552): ImapHandler->open()
#2 C:\inetpub\wwwroot\SuiteCRM-7.13.1\modules\InboundEmail\InboundEmail.php(6431): InboundEmail->getImapConnection()
#3 C:\inetpub\wwwroot\SuiteCRM-7.13.1\modules\Schedulers_AddJobsHere.php(601): InboundEmail->connectMailserver()
#4 C:\inetpub\wwwroot\SuiteCRM-7.13.1\modules\SchedulersJobs\SchedulersJob.php(528): pollMonitoredInboxesAOP()
#5 C:\inetpub\wwwroot\SuiteCRM-7.13.1\include\SugarQueue\SugarCronJobs.php(191): SchedulersJob->runJob()
#6 C:\inetpub\wwwroot\SuiteCRM-7.13.1\include\SugarQueue\SugarCronJobs.php(233): SugarCronJobs->executeJob()
#7 C:\inetpub\wwwroot\SuiteCRM-7.13.1\cron.php(100): SugarCronJobs->runCycle()
#8 {main}
thrown in C:\inetpub\wwwroot\SuiteCRM-7.13.1\include\Imap\ImapHandler.php on line 294