Skip to content
logo Knowledgebase

ERROR: File in use, or error creating file messages

Created on  | Last modified on 

Summary

Resolve errors when trying to create or restore a backup, or when processing in Sage 50 Accounts.

Description

When creating or restoring a backup, you receive one of the following messages:

  • 'Error creating file'
  • 'Error opening file'
  • 'Error writing to file'

NOTE: These messages can also appear when the software automatically saves files, for example when reconciling your bank and saving the statement PDF.

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
  • A folder in the data path doesn't exist
  • 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

You can resolve these errors by following the steps below.

Resolution

 NOTE: To resolve this issue with the rebuild option, you'll need to be using Sage 50 Accounts v31 or above. Click here to download the latest version.

Before you start 

If the above steps don't resolve the issue, click Next.

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. Check that the location where the data saves has sufficient disk space to restore your backup.

If this doesn't resolve the issue, click Next.

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 this doesn't resolve the issue, click Next.

Does the file mentioned have 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.

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 this doesn't resolve the issue, click Next.

Does the path in the message exist?

Browse to the folder in the message, for example, if the message is:
'Error creating file C:\ProgramData\Sage\Accounts\2024\Company.000\Reports\VAT\Miscellaneous Reports\TAXCODES.report'

Browse to C:\ProgramData\Sage\Accounts\2024\Company.000\Reports\VAT\Miscellaneous Reports

Can you 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 ensure Hidden Items is ticked.

 

If the file exists Right-click on the file, click Rename and delete the last three letters and type OLD then press Enter.

If you can't rename the file, it might be locked.
If the file doesn't exist Click File then click New and click Text Document, then type the full name of the file, for example, QUEUE.DTA and press Enter.

Create the missing folder and try the restore or back up again

For example, if C:\ProgramData\Sage\Accounts\2021\Company.000\Reports exists but the VAT folder is missing, create a new folder within Reports called VAT. Then create the remaining folders in the structure.

In this example, create a new folder in VAT called Miscellaneous Reports.

  1. Browse to the relevant folder, in this example, C:\ProgramData\Sage\Accounts\2024\Company.000\Reports.
  2. Click File then click New and click Folder and type the relevant folder name, in this example VAT then press Enter.
  3. Double-click the new folder and click File then click New and click Folder.
  4. Type the relevant folder name, in this example Miscellaneous Reports and press Enter.
  5. Try the restore or back up again.

If this doesn't resolve the issue, click Next.

Restart the computer which holds the Sage data

If you can't rename the file, it may be locked open on the server. 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 may be due to your Windows permissions. Refer to your network administrator for further advice about how to check and amend Windows permissions.

If you can rename the file, try the restore or back up again. If this doesn't resolve the issue, click Next.

Remove the hidden attribute on all files within company.000

NOTE: This should be done 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 and the /D ensures this also applies to all of the sub folders.

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

    If the message still appears but refers to a different folder, for example, Reports, you must follow the steps again on the relevant folder.

If this doesn't resolve the issue, check the Virtual Store. If Program Data is present in the Virtual Store, this may 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 is still unresolved, click Next.

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 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 and the data directory is shown in the Program Details area.

    Copy the following folders. Depending on your version, some of these folders may not 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 option Select the program from a list and click OK then click Notepad and click OK.
  8. Change the path to the new folder location for the data.
  9. Click File then click Save and click File then clcik Exit.
  10. Try the restore or back up again.

If the issue is still not resolved, click Next

Restore an alternative backup

NOTE: If the issue is backing up rather than restoring we recommend you restart this process.

To test the backup for corruption, if possible, restore a different backup. If the backup restores successfully it's likely that the original backup is corrupt.

For more information about data corruption, please visit desktophelp.sage.co.uk/accounts/errors