Top 7 Ways to Fix “Error Opening File for Writing” on Windows

Ways To Fix Error Opening File For Writing In Windows

When installing software from sources other than the Microsoft Store on your Windows PC, you may see a pop-up on your screen. The “Error opening file for writing” message prevents Windows from finishing the installation. The error can happen due to a lack of sufficient permissions, among other factors. This guide walks you through all the available solutions to fix the problem.

Good to know: Microsoft Store not working for you? Learn how to troubleshoot and take care of it.

Quick Fixes for “Error Opening File for Writing” on Windows

Before proceeding further, go through this short list of quick solutions that could solve this Windows error painlessly:

  • Run SFC/DISM commands: when you execute the SFC command, it scans for and repairs corrupted or damaged Windows system files. In addition, DISM is a helpful tool for repairing system images. We suggest running the SFC or DISM command first.
  • Use another drive for installation: you can try switching to another drive other than C:\ to install the software and see whether that changes anything.
  • Clean up temporary files: a potential reason behind this error is having a corrupted temporary file on your Windows PC. Try cleaning up temporary files.
  • Reinstall the application: many problems throughout the installation process can trigger this error. Try reinstalling the software, and make sure you get the correct installation file for your system (either 32-bit or 64-bit).
  • Create a new administrator user account: it’s also possible that you are seeing this error because you use an account with restricted permissions. The best course of action would be to create a new administrator account, as it would provide you with full permissions. You can also change the administrator.

If the basic fixes weren’t successful in taking care of the issue, you’ll need to dive deep into the more advanced methods that follow.

1. Run the Compatibility Troubleshooter

Compatibility issues can be the source of the “Error opening file for writing” message. These can happen when you want to install a third-party application that’s not compatible with the version of your operating system. You can use the Windows compatibility troubleshooter to check.

  1. Find the installer file of the program that’s causing the issue and right-click on it. In this example, we are running compatibility troubleshooting on the Python installation file. Select “Properties” from the context menu.
Context menu with "Properties" option visible.
  1. Click on the “Compatibility” tab and choose the “Run compatibility troubleshooter” button.
Clicking on "Compatibility troubleshooter" option in program properties.
  1. Click on “Try recommended settings” to continue the process.
Opting for "Try recommended settings" option in Troubleshooter mode.
  1. Press the “Test the Program” button to install the application again while testing compatibility.
Clicking on "Test the program" button in compatibility troubleshooter.
  1. Once the installer wizard pops up, try installing the application again.
Repair program installation via compatibility troubleshooter.

Tip: some issues require you to access your PC’s BIOS. We show you how.

2. Run as an Administrator

This method usually works when your user account doesn’t have administrative privileges to run an already installed app or install a program. To fix this, either use the “Run as administrator” option or log in to the admin account and launch the app.

  1. Right-click on the setup file and select “Run as Administrator.”
Clicking on "Run as Administrator" from the context menu.
  1. If running the application as an administrator helps you solve the problem, then you must repeat this step whenever you want to run this software. Alternatively, you can set it to always run with administrative privileges.
  1. Right-click on the application that you want to add administrative privileges to and choose “Properties.” In this example, the software is DB Browser for SQLite.
Bringing up "Properties" from the program context menu.
  1. Switch to the “Compatibility” tab, tick the “Run this program as an administrator” option, and click the “OK” button to save the changes.
Enabling "Run this program as an administrator" in program properties.

3. Disable Antivirus

Even though antivirus software is essential for protecting your system, it can sometimes interfere with installing and running applications, leading to errors like “Error opening file for writing.” Follow these steps to pause your antivirus:

  1. Click on the downward arrow in the system tray and right-click on your antivirus icon.
Right-clicking antivirus icon in system tray.
  1. Select the “Pause protection” option and set an interval for your antivirus to be paused. Finalize by clicking on the “Pause protection” button. This process might differ based on the antivirus you are running.
Opting for the "Pause protection" option for antivirus.
  1. Run the app and check to see whether the problem has been solved.

Tip: check out the best free third-party antivirus apps for your Windows computer.

4. Disable Controlled Folder Access

Another potential reason the “Error opening file for writing” happens is the controlled folder access security feature that protects your files from getting modified by malicious apps. Follow the steps below to turn off controlled folder access:

  1. Right-click on the Start menu and select “Settings.”
Selecting "Settings" from WinX menu.
  1. Click “Privacy & security” in the left menu and “Windows Security” on the right side.
Selecting "Windows Security" from Settings.
  1. Click the “Open Windows Security” button to view and manage your device security.
Pressing on the "Open Windows Security" button.
  1. From the left menu, go to the “Virus & threat protection” tab, then on the right side, scroll down and click “Manage ransomware protection.”
"Manage ransomware protection" option in Virus & threat protection settings.
  1. Turn off the “Controlled folder access” setting.
Toggle off "Controlled folder access" option in Windows Security,

5. Modify the Security Permissions

Another way to resolve the “Error opening file for writing” error is to modify the security permission for the setup file, allowing it to have writing permission. Follow these steps to change the security permissions of a file:

  1. Right-click on the file you’re having a problem with and press “Properties.”
Context menu with "Properties" option visible.
  1. Navigate to the “Security” tab and click the “Edit” button to modify the security permissions.
"Edit" button in the Security tab of program properties.
  1. Choose “Users” from under the “Group or user names” section, check the “Write” permission box in the “Allow” list, then press “Apply -> OK.”
Checking "Write" permissions for "Users" group.
  1. Restart your system and try to install the application again.

FYI: if you need to download Windows software, these are the best safe sources.

6. Disable User Account Control

The User Account Control (UAC) protocol eliminates unauthorized changes to your operating system, files, and folders. This aims to prevent malware from causing harm to your system. However, this feature may sometimes cause third-party installation errors, such as “Error opening file for writing.”

  1. To disable this feature, right-click on the Start menu and choose “Run.”
Selecting "Run" from WinX menu.
  1. Type “Control” in the Run prompt and click “OK.”
Typing "control" in Run window.
  1. Select “System and Security” in Control Panel.
Selecting "System and Security" in Control Panel.
  1. Click “Change User Account Control settings” in the “Security and Maintenance” section.
Clicking on "Change User Account settings" in Control Panel.
  1. Set the slider on the “Never notify” option and click “OK” to save the changes, then restart your system and try reinstalling the application that was causing the error.
Settings slider to "Never Notify" in User Account Control settings.

7. Modify Advanced Security Permissions

Sometimes changing the common security permissions is not sufficient, and you need to take things to the next level. That’s where advanced security permissions can come to your rescue.

  1. On your PC, go to the app’s installation folder. For example: C:\Program Files\DB Browser for SQLite.
  1. Right-click on that folder and select “Properties.”
Context menu with "Properties" option visible.
  1. Click on the “Security” tab and select the “Advanced” button.
Clicking on "Advanced" button in program properties.
  1. Click “Users,” then press the “Change permissions” button.
Pressing on "Changing permissions" button in program properties.
  1. Select “Add.”
Opting for "Add" button in program properties.
  1. Click on “Select a principal” to set the permission entry.
Clicking on "Select a principal" option in Permission Entry window.
  1. In the “Enter the object name to select” box, type “Everyone,” and click “Check Names -> OK.”
Typing "Everyone" in "Enter he object name to select" window.
  1. Tick the “Full control” option and press “OK.”
Ticking "Full control" option under "Basic permissions."
  1. Select “Everyone” from the “Permission entries” list, and tick the “Replace all child object permission entries …” option from the bottom. Then, click “Apply -> OK” to save the changes.
Enabling "Replace all child object permission entries..." option in Advanced Security Settings.

Tip: if you’re having trouble opening Windows Security, try these fixes!

Restoring Full Function to Your Apps

The “Error opening file for writing” message is just one issue affecting proper file function on Windows. If you’re seeing other errors, such as “Windows cannot access the specified device path or file,” check out our dedicated article on the matter to find a solution. If you’re having trouble deleting a file, read on to learn how to force-delete undeletable files in Windows.

Image credit: Pexels. All screenshots by Farhad Pashaei.

Farhad Pashaei
Farhad Pashaei

As a technophile, Farhad has spent the last decade getting hands-on experience with a variety of electronic devices, including smartphones, laptops, accessories, wearables, printers, and so on. When he isn’t writing, you can bet he’s devouring information on products making their market foray, demonstrating his unquenchable thirst for technology.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox