Zend certified PHP/Magento developer

PHP Script in Magento 2 Custom Module Works in Browser but Not Working through Cron

We have a custom module that executes a php script. When running the script through an observer event, the script runs without a problem. When running the script through Cron, the script runs but does not work correctly.

In the script, there is reference to a file in the magento root directly that we need to run the script properly. I think it might be that cron is running the script in a different directory.

Any help would be greatly appreciated.