Fix Compressed (Zipped) Folder Access Denied Error “Unable to Complete the Operation”

When you try to create a Compressed (zipped) folder in Windows, the error "Unable to complete the operation. Access is denied" may occur and the zip file is not created.

This happens is the user %TEMP% variable isn’t properly set, or the user has no "write" access to their %TEMP% folder. To fix the problem, use these steps.

1. Right-click Computer, click Properties

2. Click Advanced System Settings

(Alternately you can launch this page directly by running systempropertiesadvanced.exe)

3. Click Environment Variables

4. In the User variables for <username>, select TEMP and click Edit…

(In case the TEMP variable is missing, you’ll have to create one by clicking the New… button.)

5. Verify that the variable value is set as:

%USERPROFILE%\AppData\Local\Temp

6. Click OK.

7. Logoff and Login back to your user account.

If the variable values are correctly set and the problem still persists, verify if the user account has Full Control permissions for the user TEMP folder.

Verifying and Fixing Permissions for the %TEMP% Folder

Click Start, type %TEMP% and press {ENTER}

This opens the TEMP folder of your user account. Try creating a test file in that folder, and delete it. If you’re unable to create a test file in that folder due to insufficient access, taking ownership and assigning Full Control permissions to the folder should resolve the problem. Use these steps:

1. Open an elevated Command Prompt, click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.

2. Type the following command and press {ENTER}

takeown /f %TEMP% /r /d y

3. Then, type these commands one by one and press {ENTER} after each command:

icacls %TEMP% /grant SYSTEM:F /T
icacls %TEMP% /grant {username}:F /T

Replace "{username} with the actual user account name, such as:

icacls %TEMP% /grant John:F /T

… where John is the user name

Editor’s note: For more information on Taking Ownership and Assigning Permissions, see our earlier article How to Take Ownership of a file or folder using command-line in Windows.

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.

33 thoughts on “Fix Compressed (Zipped) Folder Access Denied Error “Unable to Complete the Operation”

  1. Great work! Truly genius. I would never never been able to come close to a solution without your help. Thank you from the bottom of m heart!!!!!!!!!

  2. Even though I could create a file in the TEMP folder, I went through the steps anyway and it fixed my problem!

  3. Thank you so much! Even though I had the full control ownership, I still could not ZIP folders, but after following the instructions for “Verifying and Fixing Permissions for the %TEMP% Folder”, it works now.

  4. Thank you!! Thank you!! Thank you!! Finally instructions that actually worked :)! I am also confused on how these settings got changed when I was able to compress files in the past but not recently.

  5. Worked like a charm – Thanks!. What I don’t understand is why I needed to do this. I was able to use the command a month ago but it would not work for me today. Who changed my system? Was this a “Microsoft update” induced error?

  6. WOW Thank you. It worked – I had the temporary file correct so I did the takeown /f %TEMP% /r /d y and all of the other commands and now I can make zip files.
    Thank you!!

  7. So glad to use this. I was becoming frustrated. The steps worked for me. Just put the spaces and colons as seen. Thank you.

  8. An easier way for me to get permission to access temp than the last three steps was to right click on the Temp folder, click properties, click the Security tab, then add my user name to the permissions section at the top.

  9. Thank you! I was like Faye too! Everything was fine, still did the steps 1-3 and it worked! Thank you so much. I was so frustrated!

  10. In my case, I had added new path to PATH variable but forgot the trailing ; (semicolon) and that was causing this problem, so check your PATH environment variable too, in fact that might be more likely suspect then TEMP.

  11. Yeah!! The last step working brilliantly! Agreed with Krystle that it’s important to put the spaces in to get the commands to work. Thank you! So rewarding.

  12. I have been trying to zip files for months and I was denied access. Somehow my user name was shortened and by replacing {username} with the actual user account name allowed me to retype my user name made everything work perfectly!

    Thank you!

  13. How do I reset this back to the way it was before I typed these commands in? I can’t save to the desktop… this is bad. Oh boy…

  14. THANK YOU! This is the only place I could find a solution to this irritating issue. I had to run the icacls commands and voila, it now works.

    THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  15. This worked like a charm, once I figured out how to open an “elevated Command Prompt”! thanks so much for the instructions–why something as simply as zipping a file should be so complicated, no idea, nor why I, the sole owner of the computer and software should not automatically have full permission to everything–incomprehensible. Thanks again!

  16. You are awesome. After going through forum after forum and trying multiple fixes unsuccessfully without finding a solution to the problem. This right here is the only solution that works. Great that someone actually found a fix for this error. Thank you so much.

  17. I had the same problem. Nothing fixed it… Until I did the last step you suggested
    THEN IT WORKED!!!! PS. spaces are important for this to work.

  18. I did not have any of the two problems above (temp was written in correctly, and I was able to create a file in the temp folder), but I still get the same error message.

  19. Thank you! Thank you! Thank you! I tried a few different websites to no avail before stumbling on to this one – problem now solved.

  20. I had this issue, but instead of having a TEMP variable in my Environment Variables I also had a TMP variable in there, I deleted the TMP one that seems to have fixed it

  21. Thank you! I have been trawling the net for a solution to this for half a day and bye jove you fixed it! Reports finally zipped and sent into work. Great work and many thanks. :o)

  22. Thanks I managed to fix it with 3 steps. But once I restart or switch on my pc before start, the problem come back again.

  23. Thank you so much for the write up! Saved my life since I have tons of files and folders to turn in a for a class assignment and the deadline is in 30 minutes!

  24. I cannot thank you enough! like Faye the values were correct and was able to create and delete the test file but the three steps did the trick and now can make compressed zip files. Thank you !

  25. Although the value in Step 5 was as it should be, and I was able to create and delete a test folder in TEMP, I was still getting this proble, so I followed Instructions 1 – 3 to verify and fix permissions and the problem was fixed.

    Thank you

  26. This happens to me whenever I try sendin one or more fille to a compressed file using the context mene. As you advised, I checked the ownership of the files and the folder that the files are in, and I own the files and folder, also I have full control over these files and folders. So what else should I do to fix this. You didn’t cover this, but I also found that when I copy a file I own, the resulting copy is owned by the Administrator, not me. I’m in the Administrator group, so this isn’t normally a problem, but shouldn’t I be the owner of the new file?

Comments are closed.

+1
Share
Tweet
Share
Pin