How to fix the backup batch file error?
When you want to set up automatic backup for the Work-IT database, you are going to use this batch file backupdb.bat.
As mentioned in the earlier articles, this file can be found in both backup-related articles
EN - Backup Work-IT database
Or
EN - Advance backup Work-IT database
Sometimes you encounter this issue when you try to run the backupdb.bat file :
In similar issues, you need to add the Windows admin user (in this example, "workit") to the SQL Server logins and assign the required roles:
(a) Add the Windows user to the SQL Server Logins list in SSMS (SQL Server Management Studio)
If the user does not appear under Security → Logins, then follow these steps to add the user. Otherwise, skip this section and continue with section (b)
- After logging into SSMS, go to Security → Logins, right‑click, and select "New Login…"
Click on "Search" to locate and add the Windows user.
- Enter the user name (here: "workit")
- Click on "Check Names" to verify and locate the user.
5. Once the full Windows user name appears, click "OK" to confirm and proceed.
6. Then click "OK" once more.
(b) Assign the necessary roles to the user.
Right‑click the user you have added, and select "Properties".
- From the ‘User Mapping’ page, select the database to which you want to assign roles for the user (In this example, the database name matches the user name, "workit".).
- Select at least these two roles: (In my example, I assigned all roles to this user.)
- db_backupoperator
- db_owner
4. Then click "OK" to confirm.