@ECHO OFF :: Check Windows version: minimum requirement Windows :: 2000, but useful only for Windows XP SP2 and later IF NOT "%OS%"=="Windows_NT" GOTO Syntax VER | FIND "Windows NT" >NUL && GOTO Syntax :: Check command line arguments IF "%~1"=="" GOTO Syntax IF NOT "%~2"=="" GOTO Syntax IF NOT EXIST "%~1" GOTO Syntax :: Localize variable SETLOCAL SET ZoneId= :: Retrieve current ZoneId FOR /F "tokens=*" %%A IN ('MORE ^< "%~f1":Zone.Identifier 2^>NUL ^| FIND "="') DO SET %%A :: Modify existing ZoneId, but don't add one IF NOT "%ZoneId%"=="" ( ECHO Current Zone Identifier: ECHO. MORE < "%~f1":Zone.Identifier > "%~f1":Zone.Identifier ECHO [ZoneTransfer] >> "%~f1":Zone.Identifier ECHO ZoneId=1 ECHO. ECHO New Zone Identifier: ECHO. MORE < "%~f1":Zone.Identifier ) ELSE ( ECHO. ECHO The file currently has no Zone Identifier. ECHO Skipped "%~nx1" . . . ) :: Done ENDLOCAL GOTO:EOF :Syntax ECHO. ECHO UnBlock.bat, Version 1.00 for Windows 2000 and later ECHO Change a downloaded file's zone identifier to fool XP SP2's zone ECHO checking mechanism into thinking the file was downloaded from the ECHO local intranet and is safe to execute. ECHO. ECHO Usage : UNBLOCK filename ECHO. ECHO Where : "filename" is the file to be marked safe to execute ECHO. ECHO More info : http://support.microsoft.com/?kbid=883260 ECHO http://support.microsoft.com/?kbid=889815 ECHO http://support.microsoft.com/?kbid=105763 ECHO. ECHO Disclaimer : By manually marking a file safe you effectively disable ECHO the zone checking security mechanism for that file. ECHO This is absolutely NOT recommended!!! ECHO Use this batch file entirely at your own risk. ECHO. ECHO Based on an article by Bill Stewart in Windows Scripting Solutions ECHO http://www.windowsitpro.com/windowsscripting/ ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvanderwoude.com