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?
Batch file to unblock files copied from internet
Asked Answered
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.
what does
echo.>
do ? –
Covenant echo.
echoes nothing, and >
outputs this nothing to the specified file. Or in this case, to the zone identifier of the file. –
Irma 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)
This bulk operation didn't work on Windows 10. I had to use double
%
. –
Flesher @Flesher I tend towards Powershell solutions on Windows 10 –
Colton
You can use streams -d path/to/file.zip This can be found here http://technet.microsoft.com/en-us/sysinternals/bb897440
© 2022 - 2024 — McMap. All rights reserved.
echo.>"myDownloadedFile.exe":Zone.Identifier
– Scut