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.
Compressed (Zipped) Folder Access Denied error occurs if the user %TEMP%
variable isn’t properly set, or the user has no “write” access to their %TEMP%
folder.
Instructions in this article apply to all versions of Windows, including Windows 10/11.
[Fix] Compressed (Zipped) Folder Access Denied Error
Step 1: Fix the TEMP environment variable
To fix the Compressed (Zipped) Folder Access Denied Error, fix the %TEMP%
variable using these steps:
- Right-click “This PC” and click Properties.
- Click Advanced System Settings.
(Alternately, you can launch this dialog directly by runningsystempropertiesadvanced.exe
) - Click Environment Variables
- In the User variables for <username>, select TEMP and click Edit…
(In case theTEMP
variable is missing, you’ll have to create one by clicking the New… button.)
- Verify that the variable value is set as:
%USERPROFILE%\AppData\Local\Temp
- Click OK.
- Log off and log back into 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.
Step 2: Verify and Fix Permissions for the %TEMP% Folder
If Step 1 doesn’t help or the %TEMP%
variable is intact, then the next step is to verify and, if necessary, fix the NTFS permission for the %TEMP%
folder. Follow these steps:
Verify the TEMP folder permissions
- 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. Follow these steps:
Fix the TEMP folder permissions
- Open an elevated or Administrator Command Prompt.
- Type these commands one by one and press Enter after each command:
takeown /f %temp% /r /d y icacls %temp% /reset icacls %temp% /inheritance:r icacls %temp% /grant %username%:(OI)(CI)F /t /c icacls %temp% /grant *S-1-5-32-544:(OI)(CI)F /t /c icacls %temp% /grant *S-1-5-18:(OI)(CI)F /t /c md %temp%\Low icacls %temp%\Low /setintegritylevel (OI)(CI)low
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.
That’s it! You’ve fixed the %TEMP%
user variable and TEMP
folder permissions now. This should resolve the Compressed (Zipped) Folder Access Denied Error.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
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?
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
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 !
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!
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.
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)
Oh my goodness, thank you thank you thank you!!! So glad I came upon this post!!
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
Thanks so much! This fixed my issue.
Thank you! Thank you! Thank you! I tried a few different websites to no avail before stumbling on to this one – problem now solved.
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.
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.
YAAAAAAAAAAAAAAYYYYYYYYYYYYYYY!!!!!!! Thank you!
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.
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!
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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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…
Superb, thank you!
I bow to your detailed knowledge Sir!
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!
YEA!!!!!!!!!! Such a good feeling when you try something and it actually works… brilliant!
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.
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.
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!
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.
So glad to use this. I was becoming frustrated. The steps worked for me. Just put the spaces and colons as seen. Thank you.
It works like a charm! thanks! 🙂
GREATTT! Thank you so muchhh. This is so brilliant!
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!!
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?
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.
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.
Even though I could create a file in the TEMP folder, I went through the steps anyway and it fixed my problem!
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!!!!!!!!!
Thank you.
Thank you that was amazing it is fixed I appreciate this valuable advice
Thanks so much! This fixed my issue.
All my permissions were okay, was able to create/delete file, but following others’ lead on here I executed steps 1-3 and it worked perfectly. I can finally zip the pictures and move them to the external hard drive. Yay! Thanks to everyone who input & commented.
Like someone commented above, I also had a TMP file in Environmental Variables. I deleted this and now I can zip perfectly. Thanks for your clear steps.
I was able to follow the suggestions (although none worked) until I got to “Open an elevated or Administor Command Prompt” in Step 2. How, exactly, does one open an Administor Command Prompt?
@Trebor:
Right-click Start, and click Run.
Type cmd.exe in the Run dialog
Press Ctrl + Shift and Enter.
Awesome instructions. Even though the permissions were set correctly. I followed steps 1-3 to fix permissions. Now able to create zip files.