@echo off
:: Yêu cầu chạy với quyền Administrator
net session >nul 2>&1
if %errorLevel% neq 0 (
echo Vui lòng chạy với quyền Administrator.
pause
exit
)
echo Tắt Windows Defender...
:: Tắt dịch vụ Windows Defender
sc stop WinDefend
sc config WinDefend start= disabled
:: Tắt Real-time protection bằng registry
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v DisableRealtimeMonitoring /t REG_DWORD /d 1 /f
:: Tắt Windows Defender hoàn toàn
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
:: Tắt Tamper Protection (Lưu ý: không thể tắt qua script, phải tắt thủ công hoặc qua Intune/GPO)
echo Hoàn tất. Có thể cần khởi động lại máy tính.
pause
--------------------------------------------------------------------------------------------------------------------------------------------
@echo off
title Tắt Windows Defender vĩnh viễn
echo.
echo === DANG TAT WINDOWS DEFENDER... ===
timeout /t 2 /nobreak >nul
:: Tắt Windows Defender Real-Time Protection
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
:: Tắt Tamper Protection (nếu có)
REG ADD "HKLM\SOFTWARE\Microsoft\Windows Defender\Features" /v TamperProtection /t REG_DWORD /d 0 /f
:: Tắt các thành phần bảo vệ
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v DisableBehaviorMonitoring /t REG_DWORD /d 1 /f
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v DisableOnAccessProtection /t REG_DWORD /d 1 /f
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v DisableScanOnRealtimeEnable /t REG_DWORD /d 1 /f
:: Dừng và vô hiệu hóa dịch vụ Windows Defender (chỉ hoạt động nếu không bị bảo vệ bởi hệ thống)
sc stop WinDefend
sc config WinDefend start= disabled
echo.
echo === DA TAT DEFENDER. VUI LONG KHOI DONG LAI MAY ===
pause
--------------------------------------------------------------------------------------------------------------------------------------------------
@echo off
:: Bật RDP
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
:: Bật firewall rule RDP mặc định
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
:: Tắt tất cả rule RDP hiện có để tránh xung đột
netsh advfirewall firewall delete rule name="Allow RDP from 192.168.1.80"
:: Tạo rule chỉ cho phép IP 192.168.1.80 được truy cập RDP
netsh advfirewall firewall add rule name="Allow RDP from 192.168.1.80" dir=in action=allow protocol=TCP localport=3389 remoteip=192.168.1.80 profile=any
:: Tạo rule chặn tất cả IP khác truy cập RDP
netsh advfirewall firewall add rule name="Block RDP from others" dir=in action=block protocol=TCP localport=3389 remoteip=any profile=any
echo RDP đã được bật và giới hạn IP 192.168.1.80.
pause
--------------------------------------------------------------------------------------------------------------------------------------------
@echo off
title Restore TeraByte Image
:RESTART
cls
echo ====================================
echo RESTORING SYSTEM IMAGE - PLEASE WAIT...
echo ====================================
echo.
:: Thiết lập đường dẫn file image và ổ đích
set IMAGE_PATH=C:\Users\GauGau\Desktop\1511.TBI
set DEST_DRIVE=1
:: Kiểm tra file .TBI có tồn tại không
if not exist "%IMAGE_PATH%" (
echo ERROR: File %IMAGE_PATH% not found!
pause
exit /b
)
:: Kiểm tra imagew.exe có tồn tại không
if not exist "C:\Users\GauGau\Desktop\terabyte_drive_image\imagew.exe" (
echo ERROR: imagew.exe not found!
pause
exit /b
)
:: Chạy Image for Windows và đợi nó kết thúc
start /wait "" "C:\Users\GauGau\Desktop\terabyte_drive_image\imagew.exe" /r /f:%IMAGE_PATH% /d:%DEST_DRIVE% /v /uy /um
:: Sau khi xong, hiển thị thông báo
echo.
echo ====================================
echo RESTORE COMPLETED!
echo ====================================
echo.
echo Nhan phim bat ky de tiep tuc...
pause >nul
:: Chạy file terabyte.BAT trên Desktop rồi thoát
start "" "%USERPROFILE%\Desktop\terabyte.BAT"
exit