Wednesday, February 22, 2012

"Unblock" files recursively with Streams from Sysinternals

If you're moving files (i.e. a asp.net website) from another computer to a server running Windows 2008 Server (or similarly new version) you'll risk having to unblock all the files one-by-one as they are deemed "not safe". I'm guessing this can be rectified by the network/domain/whatever-admins by defining what parts of the network is considered safe to copy files from.

But if they aren't doing it you can use Streams to recursively unblock an entire directory and it's very easy to use.

First get it over here. Knowing the MS-site, that link will probably soon stop working. Just do a search for sysinternals on microsoft.com and you'll find it, probably.

Running streams.exe in a prompt gives us:
usage: streams.exe [-s] [-d]
-s Recurse subdirectories
-d Delete streams
which tells us that:
streams.exe -s -d [dir]
is the correct command line for our problem.

Done. :) Enjoy your unblocked files.