16

When we copy files (dll) from internet, Win7 blocks it. The unblock option appears as in the following image when we take the file properties. What command can I use to unblock the file from a batch file?

enter image description here

Maanu
  • 5,093
  • 11
  • 59
  • 82

3 Answers3

12

To do one is as per other suggestions. i.e either:

echo.>myDownloadedFile.dll:Zone.Identifier

or

Unblock-File myDownloadedFile.dll

but to do it 'bulk' as OP requested:

get-childitem *.jpg, *.gif | Unblock-File 

or in DOS:

FOR %a in (*.jpg *.gif) do (echo.>%a:Zone.Identifier)
OzBob
  • 4,227
  • 1
  • 39
  • 48
11

Supposedly this should work:

echo.>myDownloadedFile.exe:Zone.Identifier

See a more detailed discussion here, Unblock a file with PowerShell?, which also describes other approaches using Powershell and the streams tool from SysInternals.

Community
  • 1
  • 1
Nate Hekman
  • 6,507
  • 27
  • 30
2

You can use streams -d path/to/file.zip This can be found here http://technet.microsoft.com/en-us/sysinternals/bb897440

Loïc MICHEL
  • 24,935
  • 9
  • 74
  • 103