Stop Windows 2003 from compressing files

Tony Giangreco
Tony Giangreco used Ask the Experts™
on
We have three Windows 2003 servers in one domain. One database app we have does not work well when the files are compressed. On the driver properties, the option "Compress disk to save space" is not checked.

This week we had a problem with that DB app and the vendor noticed files were compressed so I ran this process to uncompress over 148,000 files:

compact /u /s /i *.* >>Topss-uncompress-rpt.txt

My question is how do I stop all files in this folder from being compress by windows.

I noticed, when I defrag the drive, I saw a message that the defrag process compresses old files. With 140,000, many can get old quick from a Windows O/S standpoint.

How do I safely resolve this situation long term?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
The drive itself is not compressed but is the folder in which these files are going compressed?  Do you have the ability to move all the files on that drive to another location and then just perform a quick format on the drive and move everything back?  This should make sure that there is NO compression anywhere when you are done.
Top Expert 2012

Commented:
Here is a registry key where you stop the compression of files and folders

http://benosullivan.co.uk/windows/how-to-stop-disk-cleanup-compressing-files/
did either of our suggestins help?
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Author

Commented:
Hi relliott66:

Option 1 is not a feisable solution. The server is used seven days a week and has tons of data. If I start moving files, permissions are going to get out of whack also and I don't need that problem as a side effect of the solution.

Option #2 does not appear safe enough. I'm looking for a known solution that has been run on servers many times, not just on PC's. There are fifty users that log into this server. I was looking for a known, sure method to stop the compression.

On a monthly basis, I can also run the compact/u /s command to maintain an umpressed environemnt.
I just took another look at your initial request.  Defrag does NOT compress files it just moves files, data around to more logical locations (programs and data used by the programs closer together, etc). The 'compressing' that is done in Defrag is simply putting the files next to each other. It does this so that the file access time is reduced because the files are closer to the base position of the read/write heads.

That being said, are you running a 3rd party defragger that possibly compresses?  If only the built in Windows defragger then I can't see how it is compressing the files...  Have you checked since you ran the last compact /u /s to see if any files have 'compressed' again?
Top Expert 2012
Commented:
Compression is done by Disk Cleanup

http://www.bench3.com/2009/06/how-to-use-disk-cleanup-and-how-to.html

Registry key is the way to disable
Darius: Thanks for sharing but in this case I think he was specific about it being just in regards to the Disk Defrag hence my question about the possible 3rd party that may be doing something.  You bring up a point though, maybe the next question is:  Are you running disk cleanup TG-TIS?

Also, just for my own edification Darius, changing that key will make it so that no matter what you do NOTHING will be able to compress files or folders?  I didn't read the post but I am sure you prob know offhand...
Top Expert 2012

Commented:
Right but the defrag is not the reason he\she is seeing compressed files instead the automatic disk cleanup procedure will compress the files automatically which gives you the compressed files and folders.

defrag will compress files into an orderly base not actually compressing the files instead bringing files together. Think of defrag as organizing a file drawer you have folders scattered throughout the drawer leaving empty none organized space which make things harder to find and not organized the defrag process will compress the folders into a more organized manner which like in a file drawer you would ogranize the files then push the files together to gain space.

Even though you are seeing this message when you are running a defrag this is not the reason you are seeing the compressed files instead the reason is disk cleanup. This is why I suggest to disable this feature.

The registry key disables only the disk cleanup feature and not manually compressing files\folders.
k, your defrag, as well as the associated 'compression message', explanation was simliar to my own above as well except a liitle more 'visually oriented' (which I liked btw).  I guess the cleanup on his system may be scheduled and hence it could be doing the compression as you mentioned and disabling it, if it is running on a scheduled basis, would be a valid solution.  I now after reading, and not being so lazy, noticed that the first post you mentioned just disables the portion of the cleanup that handles compression versus completely disabling the whole disk cleanup...

Thanks for explaining that key setting as well.

Author

Commented:
I appreciate the information each of you have provided.

I run Disk Cleanup about every three weeks on the drives, but I uncheck Compress Old Files so I don’t think that is causing the problem. There is no scheduled disk cleanup or defrag. I manually run MS defrag after disk cleanup. There are no 3rd party disk maintenance utilities on the server.

I'm the only admin for three servers and 50 workstations so I’m really careful what I run and install in the environment. I use Experts-Exchange multiple times a week to sear on solutions and ask for suggestions like each of you have provided. I'm not sure what is causing the repeated file compression, but I might have to use the compact /u /s on a monthly basis to keep the DB application running properly.
Just for curiousity sake, run the refedit that Darius suggessted, make sure NO files are showing as compressed and then run the disk cleanup and lets see whether anything comes up compressed or not.  If NO, then go back to regedit, undo the change, rund the disk cleanup again, with compressed unchecked, and then see if anything comes up compressed.  

An aside question - on the DB app - what app and version?  Are a lot of these backup files?  I do know that with SQL, for example, you have the ability to compress your backups on the fly.  These do not show up as compressed files but they most definitely are.  A great example is that I have a DB that normally takes up 98GB but when I back it up, using compress, the .bak file is just 78GB and the only way I know it is compressed is because of the fact that I have selected that option.
Top Expert 2012

Commented:
The ol' not to compress files within Disk Cleanup you would think that the compress files wouldn't be compressed but they actually are. When you run disk cleanup do you see the Compress Files? Is there any Space listed? If there is Disk Cleanup is doing this automatically without your permission.

Author

Commented:
The actual problem was not resolved but the suggestions helped me evaluate solutions.
sorry that we couldnt help and thank you for the points.  If you do figure out why the files are getting compressed how about posting back so we all know?  Thanks :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial