Thursday, September 16, 2010

Bulk unblock files in Windows 7

When you download files from unsafe sources like the internet, Windows will helpfully block those files to protect you.
I find that one of the most annoying and unusable feature in Windows 7.
Not because I don’t want to be safe, I do, but that feature gets in my way more often than not.
Usually, I download Visual Studio solutions with the usual libs folder, or binaries I trust. My download pattern is to let my browser open the zip file, extract all files from there, and start digging.
At this point I have all forgotten about the download, the location of the download folder, or worse, the temp folder. So when I now is prohibited by Windows to do my work, I get annoyed because there are no simple way to unblock all files in a directory tree.'
Here’s a way to make life easier:
  • Download  Streams.
  • Remember to unblock the zip file.
  • Unzip and copy streams.exe to \Windows\System32 or any other directory in your path environment variable.
Now we are ready for the manual option:
  • Hold down Shift and right-click the blocked folder.
  • Select “Open command window here”
  • Execute the following command “streams -s -d *.*”
For the automatic option, we need to modify the registry:
  • Create a new text file and rename it to something like “unblock-files-in-here.reg”.
  • Paste in the text below
  • Run the file.
  • Right-click a file and select “Unblock file”
  • Or right-click a folder and select “Unblock files in here”

Registry script:

  1. Windows Registry Editor Version 5.00  
  3. [HKEY_CLASSES_ROOT\*\shell\unblockfile]  
  4. @="Unblock file"  
  6. [HKEY_CLASSES_ROOT\*\shell\unblockfile\command]  
  7. @="cmd /c streams -d \"%1\""  
  9. [HKEY_CLASSES_ROOT\Directory\shell\unblockfilesinhere]  
  10. @="Unblock files in here"  
  12. [HKEY_CLASSES_ROOT\Directory\shell\unblockfilesinhere\command]  
  13. @="cmd /c streams.exe -d -s \"%1\""  



Lars (Sweden) said...

Thanks a million! You made my day. I was so annoyed about this Win7-file-blocking-thing. I followed your tutorial and everything worked like a charm! Now I can relax again and stop beating my computer! :)

Dan (Australia) said...

YES!!! Brilliant. 1st technique worked. Than you, thank you, thank you.. No longer dealing with the headache of manually unblocking e-v-e-r-y darn file 1-by-1 :) btw, I couldn't get the 2nd technique to work on win7

Anonymous said...

Cool and thanks.

Edgar said...

Many, many, many Thanks, you're the men, this work is great, again THANKS.