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.
- 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.
- Click on the “Compatibility” tab and choose the “Run compatibility troubleshooter” button.
- Click on “Try recommended settings” to continue the process.
- Press the “Test the Program” button to install the application again while testing compatibility.
- Once the installer wizard pops up, try installing the application again.
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.
- Right-click on the setup file and select “Run as Administrator.”
- 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.
- 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.
- Switch to the “Compatibility” tab, tick the “Run this program as an administrator” option, and click the “OK” button to save the changes.
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:
- Click on the downward arrow in the system tray and right-click on your antivirus icon.
- 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.
- 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:
- Right-click on the Start menu and select “Settings.”
- Click “Privacy & security” in the left menu and “Windows Security” on the right side.
- Click the “Open Windows Security” button to view and manage your device security.
- From the left menu, go to the “Virus & threat protection” tab, then on the right side, scroll down and click “Manage ransomware protection.”
- Turn off the “Controlled folder access” setting.
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:
- Right-click on the file you’re having a problem with and press “Properties.”
- Navigate to the “Security” tab and click the “Edit” button to modify the security permissions.
- Choose “Users” from under the “Group or user names” section, check the “Write” permission box in the “Allow” list, then press “Apply -> OK.”
- 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.”
- To disable this feature, right-click on the Start menu and choose “Run.”
- Type “Control” in the Run prompt and click “OK.”
- Select “System and Security” in Control Panel.
- Click “Change User Account Control settings” in the “Security and Maintenance” section.
- 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.
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.
- On your PC, go to the app’s installation folder. For example:
C:\Program Files\DB Browser for SQLite
.
- Right-click on that folder and select “Properties.”
- Click on the “Security” tab and select the “Advanced” button.
- Click “Users,” then press the “Change permissions” button.
- Select “Add.”
- Click on “Select a principal” to set the permission entry.
- In the “Enter the object name to select” box, type “Everyone,” and click “Check Names -> OK.”
- Tick the “Full control” option and press “OK.”
- 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.
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.
Our latest tutorials delivered straight to your inbox