Automation of Microsoft Office Applications from a non-interactive session are discouraged by Microsoft and are not supported. If by batch command you mean using the task scheduler to run a task without a user being logged on then that is an unsupported environment.
considerations-for-server-side-automation-of-office
"Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment."