ERROR: 'File in use' when processing or restoring a backup
Description

This message can occur for one of the following reasons:

  • There's no free disk space on the hard drive
  • The data path in the Company file is the incorrect format
  • You don't have sufficient access rights
  • The files are hidden
  • The backup is corrupt
  • Antivirus software is restricting access
  • A non-standard character in the file name
Cause
Resolution
▼ Restart the computer which holds the Sage data

The server can lock the file open, which prevents you from renaming it. To resolve this restart the server computer.

If restarting the server computer isn't possible, you can close the locked files:

  1. On the computer that holds the data, right-click Computer then click Manage.
  2. Expand Shared Folders, then select the Open Files folder.
  3. To close a file, right-click the file, then click Close Open File to confirm, click Yes.

Try to rename the file again.

If you still can't rename the file, it can be due to your Windows permissions. Refer to your network administrator for further advice to check and amend Windows permissions.

  • If you can rename the file, try the restore or back up again
  • If the issue persists, continue to the Check that here's enough free desk space section

▼ Check that there's enough free disk space
  1. Click Help then click About and in the Program Details area, make a note of the Data Directory.
  2. Press and hold the Windows key and press E.
  3. Click This PC.
  4. Select the data location, for example P:.
  5. Right-click the drive and select Properties.
  6. Check that free disk space is at least 5GB. If it’s less, contact your local IT to free up space.

Disk space on drive.  

If the issue persists, continue to the Check the path in the Company file is correct section.


▼ Check the path in the Company file is correct
  1. Click Help then click About and in the Program Details area, click the path to the Settings Directory.
  2. Double-click COMPANY and select the option Select the program from a list.
  3. Click OK, then click Notepad, and click OK.
  4. Ensure the path is correct and ensure there's no blank line at the top of the file.
    For example, \\Server01\SageData.
  5. If you change the path click File, click Save and select File then click Exit.

If the issue persists, continue to the Check that the file mentioned has an extension of .ini section.


▼ Check that the file mentioned has an extension of .ini

For example:
Error creating file C:\Program Files\Sage\Accounts\Desktop.ini

TIP: A file with the extension .ini is a configuration file which usually holds information about the folder options within a folder.

If the issue persists, continue to the Delete the file and try to restore or back up again section.


▼ Delete the file and try to restore or back up again

The backup includes the file .ini which already exists in the folder where the backup restores to. This is a Windows system file so it can't be overwritten. Delete the file and restore the data again. The file will restore when the data does. So delete the file again to avoid the issue the next time you restore.

  1. Note the full path in the message, for example, C:\ProgramData\Sage\Accounts\2024\Desktop.ini.
  2. Browse to the relevant folder, in this example C:\ProgramData\Sage\Accounts\2024.
  3. Select the View drop-down menu, hover over Show and tick Hidden Items.
  4. Find the file in the message, in this example, Desktop.ini.
  5. Right-click on the file and click Delete then click Yes.
    If you can't delete the file, click Next below.
  6. Open Sage Accounts and try to restore or back up again.
  7. If you're restoring, repeat steps 2 to 6.
  8. Change the Folder Options back to their original settings.

If the issue persists, continue to the Check if you can create or rename the file in the message section.


▼ Check if you can create or rename the file in the message  
  1. Note the full path in the message, for example, C:\ProgramData\Sage\Accounts\2024\Company.000\ACCDATA\QUEUE.DTA.
  2. Browse to the relevant folder, in this example C:\ProgramData\Sage\Accounts\2024\Company.000\ACCDATA.
  3. Select the View drop-down menu, hover over Show and select the Hidden Items checkbox.
If the file exists
  1. Right-click on the file and click Rename.
  2. Delete the last three letters, type OLD, then press Enter.
If you can't rename the file, it's likely locked open on the server.
If the file doesn't exist
  1. Click File, then click New, and click Text Document.
  2. Then type the full name of the file, for example, QUEUE.DTA and press Enter.

If the issue persists, continue to the Remove the hidden attribute on all files within Company.000 section.


▼ Remove the hidden attribute on all files within Company.000

NOTE: Complete this step on the computer which holds the data.

  1. Note the data path from the message, for example C:\ProgramData\Sage\Accounts\2024\Company.000.
  2. Click Start then click Run and enter CMD then press Enter.
  3. Enter CD\ and press Enter, enter CD and then first folder name. For example, CD C:\programdata and press Enter.
  4. Enter CD and the next folder name and press Enter. Repeat this for each folder up to Company.000.
  5. Enter attrib -h /S /D, for example CD C:\ProgramData\Sage\Accounts\2024\Company.000 attrib -h /S /D then press Enter.
    The -h removes the hidden attribute. The /S ensures this applies to all files in the folder. The /D ensures this also applies to all the sub folders.

  6. Close the command prompt window, try the restore or back up again.

    If the message appears again and refers to a different folder, for example, Reports, repeat the steps on that folder.

If this doesn't resolve the issue, check the Virtual Store. When Program Data is present in the Virtual Store, this can cause the issue. Check the path and if the named problem file is present, rename it. Example path:

  • C:\Users\<username>\AppData\Local\VirtualStore\Program Data\Sage\Accounts\2024

If the issue persists, continue to the Move the data to a new location section.


 ▼ Move the data to a new location

 

  1. Click Help then click About and in the Program Details area, make a note of the Settings Directory.
  2. Create a new folder on the computer which holds your Sage 50 Accounts data.
  3. If your data is on a server, share the folder and ensure that all relevant users have Modify permissions allowed.
  4. Browse to the existing Sage Accounts data directory.

    To check the data directory, open Sage Accounts, then click Help and About. The data directory is in the Program Details section.

    Copy the following folders. Depending on your version, some of these folders don't exist:
    • Accdata
    • Archives
    • Attachments
    • Bitmap
    • Configs
    • Criteria
    • Defaults
    • Exports
    • Fax
    • HMRCSubmissions
    • Imports
    • Invoices
    • Journals
    • Labels
    • Layouts
    • Letters
    • Memo
    • Reports
    • Taskopt
    • Template
    • TMail
    • VATRtns

  5. Paste these folders into the new folder created in step 2.
  6. Browse to the settings directory noted in step 1 and double-click COMPANY.
  7. Select the program from a list then click OK.
  8. Choose Notepad and click OK.
  9. Change the path to the new folder location for the data.
  10. Click File then click Save and click File then click Exit.
  11. Try the restore or back up again.

Steps to duplicate
Related Solutions