Damn You Microsoft!!

Soldato
Joined
31 Jan 2022
Posts
3,651
Location
UK
What on Earth are they thinking? I use backups on my system, frequently transfer files, and have multiple PC's that I share information with. And Microsoft go an implement a security system that marks files as "not from this PC" with a nest of warnings, flags, blocks and who knows what?! Thanks Microsoft. Another piece of totally useless junk that spread like a virus all over my PC's and backups.
Anyway, for anyone else who wants to end the madness, here are the CMD files I used.


@Echo off
title Stop Windows preserving zone information
echo.
echo This changes the setting for the CURRENT Windows user.
echo It prevents future downloads and attachments from retaining Zone.Identifier.
echo.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v SaveZoneInformation /t REG_DWORD /d 1 /f
echo.
if errorlevel 1 (
echo The registry change failed.
) else (
echo The registry change succeeded.
echo Sign out or restart Windows after running both cleanup files.
)
echo.
pause



and....



echo off
setlocal
title Remove existing Windows zone marks from all local drives

net session >nul 2>&1
if not "%errorlevel%"=="0" (
echo Requesting administrator permission...
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b
)

echo.
echo This will remove Zone.Identifier from every accessible file
echo on all FIXED and REMOVABLE local drives.
echo Network drives and optical drives are not included.
echo This may take a long time.
echo.
pause

powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$drives = Get-CimInstance Win32_LogicalDisk | Where-Object { $_.DriveType -in 2,3 -and $_.DeviceID }; foreach ($d in $drives) { $root = $d.DeviceID + '\'; Write-Host ('Cleaning ' + $root) -ForegroundColor Cyan; Get-ChildItem -LiteralPath $root -Recurse -File -Force -ErrorAction SilentlyContinue | Unblock-File -ErrorAction SilentlyContinue }; Write-Host 'Finished.' -ForegroundColor Green"

echo.
echo Cleanup finished. Some protected files may have been skipped.
echo Sign out or restart Windows.
echo.
pause
endlocal
 
Back
Top Bottom