5

Someone at my job (a sysadmin) actually performed a "cleanup" task on WinXP which at the same time compressed all the files on my HDD with the Windows compressed file attribute (Filenames get blue in Windows Explorer)

I don't actually need my files to be compressed, and I think it can also affect the performance of my PC.

I tried searching for files, selecting them with Windows explorer and deselecting the checkbox to uncompress them, but just getting the "Properties" window for 160,000 files is impossible.

Someone have an idea about this ? A .bat file to do the job ?

MaxiWheat
  • 237
  • 5
  • 12

1 Answers1

3

The compact /u command will do it. The PITA will be running it against all files, and you might want to preserve certain files compressed attributes, like c:\windows\$ntuninstall* . If you're not worried about the latter, just run compact /u /s c: and let it grind away and hope you don't run out of disk space.

If you have Cygwin installed, you could build a find | xargs compact /u with enough -name attributes to not uncompress directories that you want to keep compressed. You could also probably do the same thing with PS or (heavens) VBscript. A .BAT or FOR command is probably just asking for trouble.

It might also be best to let the IT guys do their job, or at least bring your concerns to them. It's not impossible to have a misinformed and/or junior IT guy do some unhelpful tinkering, do you have any IT guys that you trust at work?

mfinni
  • 35,711
  • 3
  • 50
  • 86
  • Works great thank you :-) I just needed to alter a bit your suggested query to : compact /u /s /i d:\* /i ignores errors (I got one a certain point for system volume folder) d:\* (I added * to include all files) – MaxiWheat Feb 25 '10 at 01:42
  • You can iterate over files and directories with the `for` command. No need for `find` or `xargs` there. You can check in the `for` loop whether it's a directory (proven to be more robust than iterating over the output of `dir` which has severe problems when facing Unicode names with Raster fonts enabled for the console window). – Joey Feb 25 '10 at 11:12