Skip to content

Instantly share code, notes, and snippets.

@x4x
Last active March 25, 2020 21:32
Show Gist options
  • Save x4x/112b36591c562bc7fbf1f6c91efeb56a to your computer and use it in GitHub Desktop.
Save x4x/112b36591c562bc7fbf1f6c91efeb56a to your computer and use it in GitHub Desktop.
winbugfix-ADV200006
@echo OFF
rem fix for win bug https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/adv200006
rem x4x 20200324
net stop webclient
sc config webclient start= disabled
rem disable prevew in explorer
REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoReadingPane /t REG_DWORD /d 1 /F
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v DisableATMFD /t REG_DWORD /d 1 /F
rem alternative disable atmfd.dll
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
if %OS%==32BIT (
echo 32bit OS
cd "%windir%\system32"
takeown.exe /f atmfd.dll
icacls.exe atmfd.dll /save atmfd.dll.acl
rem icacls.exe atmfd.dll /grant %remoteAdmin%:F
icacls.exe atmfd.dll /grant Administrators:F
rename atmfd.dll x-atmfd.dll
)
if %OS%==64BIT (
echo 64bit OS
cd "%windir%\system32"
takeown.exe /f atmfd.dll
icacls.exe atmfd.dll /save atmfd.dll.acl
icacls.exe atmfd.dll /grant Administrators:F
rename atmfd.dll x-atmfd.dll
cd "%windir%\syswow64"
takeown.exe /f atmfd.dll
icacls.exe atmfd.dll /save atmfd.dll.acl
icacls.exe atmfd.dll /grant Administrators:F
rename atmfd.dll x-atmfd.dll
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment