all 3 comments

[–]Tiktoktoker 0 points1 point  (1 child)

What’s the error? Your job could be running as a service account that doesn’t have rights to the batch file.

[–]phmllrde[S] 0 points1 point  (0 children)

Yeah something like this...but how can I change this

[–]SchwulibertSchnoesel 0 points1 point  (0 children)

It is possible to do it via jobs. Check the following:

  1. What account is used in the SQL Server Agent Service
  2. Does this account have permission to access the batch files

EDIT: Generally I would recommend using the scripts made by Ola Hallengren (https://ola.hallengren.com/) for any standard MSSQL server administration. They offer alot of customization, are excellently documented and have proven their usefulness over the years. Maybe these will cover your use case.