Share toàn bộ mã nguồn sử dụng làm công cụ RemoveAppxPackageTool

Trên tình thần chia sẻ cho những bạn nào chưa biết mà muốn học hỏi về batch script nên hôm nay tôi quyết định share miễn phí toàn bộ code cũng như cách thức mà tôi đã tạo ra được công cụ hoàn chỉnh để các bạn tham khảo hoặc có thể tự tạo cho mình một công cụ để giúp ích cho cộng đồng sử dụng Windows.


1. Tạo công cụ RemoveAppxPackageTool.cmd

Trước hết bạn cần tải thư mục data tại đây. Khi tải về máy giải nén bạn tạo một thư mục mới lấy tên gì cũng được ví dụ như RemoveAppxPackageTool xong copy thư mục data vào đấy. Dưới đây là code để tạo công cụ RemoveAppxPackageTool.cmd lưu ý với code tiếng Anh thì các bạn chọn Encoding: ANSI còn tiếng Việt thì chọn Encoding: UTF-8 còn định dạng là All files

Code tiếng Anh

:: Name     : RemoveAppxPackageTool.cmd

:: Author   : Nguyen Tuan.

:: Website  : www.blogthuthuatwin10.com



chcp 65001 >nul

@echo off

title RemoveAppxPackageTool

color 3f

chcp 65001 >nul

cd /d %~dp0

cls

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if "%errorlevel%" NEQ "0" (

 echo: Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"

 echo: UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

 "%temp%\getadmin.vbs" & exit

)

if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"



:: Menu of tool.

:: /*************************************************************************************/

:Menu

cls

echo.Main menu

echo.



echo. ID Option

echo.

echo. 1 Get-AppxPackage

echo. 2 Remove-AppxPackage

echo. 3 Add-AppxPackage

echo. 4 Get-AppxProvisionedPackage

echo. 5 Remove-AppxProvisionedPackage

echo. 6 Remove-Package

echo. 7 Enable Windows Features

echo. 8 Disable Windows Features

echo. 9 Start Service

echo. 10 Stop Service

echo. 11 Enable Tweaks

echo. 12 Backup Drivers

echo. 13 Disk Cleanup

echo. 14 System Restore

echo. 15 Uninstall Software

echo. 16 Exit the program

echo. 17 Restart the computer

echo.

set /p option=Select ID and press Enter :

if %option% EQU 1 (

    goto Get-AppxPackage

) else if %option% EQU 2 (

    goto Remove-AppxPackage

) else if %option% EQU 3 (

    goto Add-AppxPackage

) else if %option% EQU 4 (

    goto Get-AppxProvisionedPackage

) else if %option% EQU 5 (

    goto Remove-AppxProvisionedPackage

) else if %option% EQU 6 (

    goto Version

) else if %option% EQU 7 (

    goto Enable-WindowsOptionalFeature

) else if %option% EQU 8 (

    goto Disable-WindowsOptionalFeature

) else if %option% EQU 9 (

    goto Start-Service

) else if %option% EQU 10 (

    goto Stop-Service

) else if %option% EQU 11 (

    goto EnableTweaks

) else if %option% EQU 12 (

    goto BackupDrivers

) else if %option% EQU 13 (

    goto DiskCleanup

) else if %option% EQU 14 (

    goto SystemRestore

) else if %option% EQU 15 (

    goto UninstallSoftware

) else if %option% EQU 16 (

    goto Exitprogram

) else if %option% EQU 17 (

    goto Restart

) else (

    goto Menu

)

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Get-AppxPackage.

:: /*************************************************************************************/

:Get-AppxPackage

cls

echo.Do you want to Get-AppxPackage for current user or all users?

choice /c EAM /n /m "Press E for current user, A for all users, M for return Main menu: "

if %errorlevel% EQU 1 goto Currentuser

if %errorlevel% EQU 2 goto Allusers

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Currentuser

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Get-AppxPackage.ps1'"

goto Menu

:: ------------------------------------------------------------------------------------



:Allusers

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Get-AppxPackageAll.ps1'"

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Remove-AppxPackage.

:: /*************************************************************************************/

:Remove-AppxPackage

cls

echo.Do you want to remove each app or all apps?

choice /c EAM /n /m "Press E for remove each app, A for remove all apps, M for return Main menu: "

if %errorlevel% EQU 1 goto Removeeachapp

if %errorlevel% EQU 2 goto Removeallapps

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Removeeachapp

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxPackage.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to remove each app? (Yes/No) "

if %errorlevel% EQU 1 goto Removeeachapp

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:Removeallapps

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxPackageAll.ps1'"

cls

echo.The operation completed successfully.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Add-AppxPackage.

:: /*************************************************************************************/

:Add-AppxPackage

cls

echo.Do you want to add each app or all apps?

choice /c EAM /n /m "Press E for add each app, A for all apps, M for return Main menu: "

if %errorlevel% EQU 1 goto Addeachapp

if %errorlevel% EQU 2 goto Addallapps

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Addeachapp

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Add-AppxPackage.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to add each app? (Yes/No) "

if %errorlevel% EQU 1 goto Addeachapp

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:Addallapps

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Add-AppxPackageAll.ps1'"

cls

echo.The operation completed successfully.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Get-AppxProvisionedPackage.

:: /*************************************************************************************/

:Get-AppxProvisionedPackage

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Get-AppxProvisionedPackage.ps1'"

cls

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Remove-AppxProvisionedPackage.

:: /*************************************************************************************/

:Remove-AppxProvisionedPackage

cls

echo.Do you want to remove each package or all packages?

choice /c EAM /n /m "Press E for remove each package, A for remove all packages, M for return Main menu: "

if %errorlevel% EQU 1 goto Removeeachpackage

if %errorlevel% EQU 2 goto Removeallpackages

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Removeeachpackage

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxProvisionedPackage.ps1'"

cls

choice /c YN /n /m "Do you want to continue remove each package program? (Yes/No) "

if %errorlevel% EQU 1 goto Removeeachpackage

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:Removeallpackages

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxProvisionedPackageAll.ps1'"

cls

echo.The operation completed successfully.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Checking Version.

:: /*************************************************************************************/

:Version

cls

ver | findstr /i "10\.0\.10240"

if %ERRORLEVEL% EQU 0 (

echo.You are running Windows 10, Version 1507.

echo.This option only supported for Windows 10, Version 1703.

pause

goto Menu

)

ver | findstr /i "10\.0\.10586"

if %ERRORLEVEL% EQU 0 (

echo You are running Windows 10, Version 1511.

echo.This option only supported for Windows 10, Version 1703.

pause

goto Menu

)

ver | findstr /i "10\.0\.14393"

if %ERRORLEVEL% EQU 0 (

echo You are running Windows 10, Version 1607.

echo.This option only supported for Windows 10, Version 1703.

pause

goto Menu

)

ver | findstr /i "10\.0\.15063"

if %ERRORLEVEL% EQU 0 (

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

copy data\amd64\SetACL.exe C:\Windows\System32\SetACL.exe

) ELSE (

copy data\x86\SetACL.exe C:\Windows\System32\SetACL.exe

)

set Packages=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages

SetACL -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" -ot reg -actn setowner -ownr "n:%USERDOMAIN%\%USERNAME%"

SetACL -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" -ot reg -actn ace -ace "n:%USERDOMAIN%\%USERNAME%;p:full"

goto Remove-Package

)

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Remove-Package.

:: /*************************************************************************************/

:Remove-Package

cls

echo.Remove-Package Menu

echo.

echo.ID Option   ID Option

echo.

echo.1 Connect   19 Media Features     

echo.2 Cortana   20 Microsoft Message Queue (MSMQ) Server

echo.3 Get Help  21 Microsoft Print to PDF  

echo.4 Microsoft Edge  22 MultiPoint Connector  

echo.5 Mixed Reality Portal 23 Print and Document Services 

echo.6 OneDrive  24 RAS Connection Manager Adminitration Kit (CMAK)  

echo.7 Quick Assist  25 Remove Differential Compression API Support  

echo.8 Windows Defender 26 RIP Listener 

echo.9 Windows Spotlight 27 Services for NFS

echo.10 Windows Photo Viewer 28 Simple Network Management Protocol (SNMP)

echo.11 Snipping Tool  29 Simple TCPIP services (i.e. echo daytime etc) 

echo.12 Active Directory 30 SMB 1.0/CIFS File Sharing Support   

echo.13 Containers  31 Telnet-TFTP Client   

echo.14 Assigned Access  32 Windows Identify Foundation 3.5

echo.15 Device Lockdown  33 Windows Powershell 2.0 

echo.16 Hyper-V   34 Windows TIFF IFilter       

echo.17 Internet Explorer 35 XPS Services 

echo.18 Legacy Components 36 XPS Viewer

echo.

echo.37 Return Main menu

echo.    



set /p option=Select ID and press Enter :

if %option% EQU 1 (

    call :Connect

) else if %option% EQU 2 (

    call :Cortana

) else if %option% EQU 3 (

    call :GetHelp

) else if %option% EQU 4 (

    goto MicrosoftEdge

) else if %option% EQU 5 (

    goto MixedRealityPortal

) else if %option% EQU 6 (

    goto OneDrive

) else if %option% EQU 7 (

    goto QuickAssist

) else if %option% EQU 8 (

    goto WindowsDefender

) else if %option% EQU 9 (

    goto WindowsSpotlight

) else if %option% EQU 10 (

    goto PhotoViewer

) else if %option% EQU 11 (

    goto SnippingTool

) else if %option% EQU 12 (

    goto ActiveDirectory

) else if %option% EQU 13 (

    goto Containers

) else if %option% EQU 14 (

    goto AssignedAccess

) else if %option% EQU 15 (

    goto DeviceLockdown

) else if %option% EQU 16 (

    goto Hyper-V

) else if %option% EQU 17 (

    goto InternetExplorer11

) else if %option% EQU 18 (

    goto LegacyComponents

) else if %option% EQU 19 (

    goto MediaFeatures

) else if %option% EQU 20 (

    goto MessageQueue

) else if %option% EQU 21 (

    goto PrinttoPDF

) else if %option% EQU 22 (

    goto MultiPointConnector

) else if %option% EQU 23 (

    goto PrintandDocument

) else if %option% EQU 24 (

    goto RASConnectionManager

) else if %option% EQU 25 (

    goto DifferentialCompressionAPI

) else if %option% EQU 26 (

    goto RIPListener

) else if %option% EQU 27 (

    goto ServicesforNFS

) else if %option% EQU 28 (

    goto SimpleNetwork

) else if %option% EQU 29 (

    goto SimpleTCPIP

) else if %option% EQU 30 (

    goto FileSharingSupport

) else if %option% EQU 31 (

    goto TelnetClient

) else if %option% EQU 32 (

    goto IdentifyFoundation

) else if %option% EQU 33 (

    goto Powershell2.0

) else if %option% EQU 34 (

    goto TIFFIFilter

) else if %option% EQU 35 (

    goto XPSServices

) else if %option% EQU 36 (

    goto XPSViewer

) else if %option% EQU 37 (

    goto Menu

) else (

    goto Remove-Package

)

:: ------------------------------------------------------------------------------------



:Connect

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Connect

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Connect

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-PPIProjection-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-PPIProjection-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-PPIProjection-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-PPIProjection-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:Cortana

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Cortana

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Cortana

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Cortana-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Cortana-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /Remove-Package /packagename:Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Cortana-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Cortana-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /Remove-Package /packagename:Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

: ------------------------------------------------------------------------------------



:GetHelp

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-ContactSupport

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-ContactSupport

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:MicrosoftEdge

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MicrosoftEdge

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MicrosoftEdge

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:MixedRealityPortal

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MixedRealityPortal

if %errorlevel% EQU 2 goto Menu

: --------------------------------------------------



:Remove-MixedRealityPortal

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-WOW64-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-WOW64-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-WOW64-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-WOW64-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy"

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy" /grant %username%:F

rd /s /q "%SystemRoot%\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy"

cls

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

) ELSE (

cls

echo.You are running 32-bit version of Windows, Mixed Reality Portal app only support 64-bit version.

pause

goto Remove-Package

)

: ------------------------------------------------------------------------------------



:OneDrive

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-OneDrive

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-OneDrive

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

taskkill /f /im OneDrive.exe

start /wait %systemroot%\SysWOW64\OneDriveSetup.exe /uninstall

reg delete "%Packages%\Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

reg delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

taskkill /f /im OneDrive.exe

start /wait %systemroot%\System32\OneDriveSetup.exe /uninstall

reg delete "%Packages%\Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:QuickAssist

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-QuickAssist

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-QuickAssist

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:WindowsDefender

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-WindowsDefender

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-WindowsDefender

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v SettingsPageVisibility /t REG_SZ /d "hide:windowsdefender" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance" /v Enabled /t REG_DWORD /d 0 /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SecurityHealth /f

reg delete "%Packages%\Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Group-Policy-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Shield-Provider-Core-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Group-Policy-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Shield-Provider-Core-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris"

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris" /grant %username%:F

rd /s /q "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

) ELSE (

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v SettingsPageVisibility /t REG_SZ /d "hide:windowsdefender" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance" /v Enabled /t REG_DWORD /d 0 /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SecurityHealth /f

reg delete "%Packages%\Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Group-Policy-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Shield-Provider-Core-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Group-Policy-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Shield-Provider-Core-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris"

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris" /grant %username%:F

rd /s /q "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

)

cls

echo.The operation completed successfully.

echo.How to delete the Windows Defender Security Center icon in the Start menu.

echo See details https://goo.gl/8HtNsc

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:WindowsSpotlight

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-WindowsSpotlight

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-WindowsSpotlight

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:PhotoViewer

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-PhotoViewer

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-PhotoViewer

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:SnippingTool

cls

choice /c YN /n /m "WARNING: The application can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-SnippingTool

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-SnippingTool

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:ActiveDirectory

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-ActiveDirectory

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-ActiveDirectory

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:Containers

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Containers

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Containers

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:AssignedAccess

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-AssignedAccess

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-AssignedAccess

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:DeviceLockdown

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-DeviceLockdown

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-DeviceLockdown

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:Hyper-V

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Hyper-V

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Hyper-V

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KMCL-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-HvSocket-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KMCL-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-HvSocket-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KMCL-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-HvSocket-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KMCL-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-HvSocket-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:InternetExplorer11

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-InternetExplorer11

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-InternetExplorer11

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~~11.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~amd64~~11.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~~11.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~amd64~~11.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~x86~~11.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~x86~~11.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~x86~~11.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~x86~~11.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:LegacyComponents

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-LegacyComponents

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-LegacyComponents

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:MediaFeatures

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MediaFeatures

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MediaFeatures

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:MessageQueue

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MessageQueue

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MessageQueue

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:PrinttoPDF

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-PrinttoPDF

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-PrinttoPDF

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:MultiPointConnector

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MultiPointConnector

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MultiPointConnector

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:PrintandDocument

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-PrintandDocument

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-PrintandDocument

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:RASConnectionManager

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-RASConnectionManager

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-RASConnectionManager

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:DifferentialCompressionAPI

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-DifferentialCompressionAPI

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-DifferentialCompressionAPI

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-RDC-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RDC-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-RDC-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RDC-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:RIPListener

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-RIPListener

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-RIPListener

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-RasRip-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasRip-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-RasRip-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasRip-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:ServicesforNFS

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-ServicesforNFS

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-ServicesforNFS

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:SimpleNetwork

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-SimpleNetwork

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-SimpleNetwork

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SNMP-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SNMP-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SNMP-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SNMP-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:SimpleTCPIP

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-SimpleTCPIP

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-SimpleTCPIP

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:FileSharingSupport

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-FileSharingSupport

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-FileSharingSupport

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SMB1-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SMB1-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SMB1-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SMB1-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:TelnetClient

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-TelnetClient

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-TelnetClient

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:IdentifyFoundation

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-IdentifyFoundation

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-IdentifyFoundation

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:Powershell2.0

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Powershell2.0

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Powershell2.0

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:TIFFIFilter

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-TIFFIFilter

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-TIFFIFilter

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:XPSServices

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-XPSServices

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-XPSServices

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:XPSViewer

cls

choice /c YN /n /m "WARNING: This feature can not be reinstalled after remove. Are you sure? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-XPSViewer

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-XPSViewer

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.The operation completed successfully.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Enable-WindowsOptionalFeature.

:: /*************************************************************************************/

:Enable-WindowsOptionalFeature

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Enable-WindowsOptionalFeature.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to continue Enable Windows Features program? (Yes/No) "

if %errorlevel% EQU 1 goto Enable-WindowsOptionalFeature

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Disable-WindowsOptionalFeature.

:: /*************************************************************************************/

:Disable-WindowsOptionalFeature

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Disable-WindowsOptionalFeature.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to continue Disable Windows Features program? (Yes/No) "

if %errorlevel% EQU 1 goto Disable-WindowsOptionalFeature

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Start-Service.

:: /*************************************************************************************/

:Start-Service

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Start-Service.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to continue Start Service program? (Yes/No) "

if %errorlevel% EQU 1 goto Start-Service

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Stop-Service.

:: /*************************************************************************************/

:Stop-Service

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Stop-Service.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to continue Stop Service program? (Yes/No) "

if %errorlevel% EQU 1 goto Stop-Service

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/



:: Enable Tweaks.

:: /*************************************************************************************/

:EnableTweaks

cls

echo.Enable Tweaks

echo.

echo. Option       Enable Disable

echo.

echo. Allow Cortana      1 23 

echo. Allow Cortana above lockscreen    2 24 

echo. Allow search and Cortana use location   3 25 

echo. Allow suggested apps in Windows Ink Workspace  4 26 

echo. Allow Windows Ink Workspace    5 27

echo. Do not allow web search     6 28

echo. Do not show Windows tips    7 29

echo. Notify for download and auto install any updates 8 30

echo. Removes Notifications and Action Center   9 31

echo. Show first sign-in animation    10 32 

echo. Turn off Autoplay     11 33 

echo. Turn off location     12 34

echo. Turn off OneDrive     13 35

echo. Turn off auto install suggest apps   14 36   

echo. Turn off Microsoft consumer experiences   15 37

echo. Turn off apps download and install update  16 38

echo. Turn off the Store application    17 39

echo. Turn off Automatic Maintenance    18 40

echo. Turn off Windows Defender Antivirus   19 41

echo. Turn off Real-time protection    20 42

echo. Turn off Windows Defender SmartScreen   21 43

echo. Turn off Media Sharing     22 44

echo. 

echo. Return Main menu (45)

echo.



set /p option=Select ID and press Enter :

if %option% EQU 1 (

    goto TurnonCortana

) else if %option% EQU 2 (

    goto TurnonCortanaabovelockscreen

) else if %option% EQU 3 (

    goto TurnonsearchandCortanauselocation

) else if %option% EQU 4 (

    goto TurnonsuggestedappsinWindowsInkWorkspace

) else if %option% EQU 5 (

    goto TurnonWindowsInkWorkspace

) else if %option% EQU 6 (

    goto Donotallowwebsearch

) else if %option% EQU 7 (

    goto DonotshowWindowstips

) else if %option% EQU 8 (

    goto TurnonNotifyfordownloadandautoinstall

) else if %option% EQU 9 (

    goto RemovesActionCenter

) else if %option% EQU 10 (

    goto Enableshowfirstsign-inanimation

) else if %option% EQU 11 (

    goto TurnoffAutoplay

) else if %option% EQU 12 (

    goto Turnofflocation

) else if %option% EQU 13 (

    goto TurnoffOneDrive

) else if %option% EQU 14 (

    goto Turnoffautoinstallsuggestapps

) else if %option% EQU 15 (

    goto TurnoffMicrosoftconsumerexperiences

) else if %option% EQU 16 (

    goto Turnoffappsdownloadandinstallupdate

) else if %option% EQU 17 (

    goto TurnofftheStoreapplication

) else if %option% EQU 18 (

    goto TurnoffAutomaticMaintenance

) else if %option% EQU 19 (

    goto TurnoffWindowsDefenderAntivirus

) else if %option% EQU 20 (

    goto TurnoffReal-timeprotection

) else if %option% EQU 21 (

    goto TurnoffWindowsDefenderSmartScreen

) else if %option% EQU 22 (

    goto TurnoffMediaSharing

) else if %option% EQU 23 (

    goto TurnoffCortana

) else if %option% EQU 24 (

    goto TurnoffCortanaabovelockscreen

) else if %option% EQU 25 (

    goto TurnoffsearchandCortanauselocation

) else if %option% EQU 26 (

    goto TurnoffsuggestedappsinWindowsInkWorkspace

) else if %option% EQU 27 (

    goto TurnoffWindowsInkWorkspace

) else if %option% EQU 28 (

    goto Allowwebsearch

) else if %option% EQU 29 (

    goto ShowWindowstips

) else if %option% EQU 30 (

    goto TurnoffNotifyfordownloadandautoinstall

) else if %option% EQU 31 (

    goto TurnonActionCenter

) else if %option% EQU 32 (

    goto Disableshowfirstsign-inanimation

) else if %option% EQU 33 (

    goto TurnonAutoplay

) else if %option% EQU 34 (

    goto Turnonlocation

) else if %option% EQU 35 (

    goto TurnonOneDrive

) else if %option% EQU 36 (

    goto Turnonautoinstallsuggestapps

) else if %option% EQU 37 (

    goto TurnonMicrosoftconsumerexperiences

) else if %option% EQU 38 (

    goto Turnonappsdownloadandinstallupdate

) else if %option% EQU 39 (

    goto TurnontheStoreapplication

) else if %option% EQU 40 (

    goto TurnonAutomaticMaintenance

) else if %option% EQU 41 (

    goto TurnonWindowsDefenderAntivirus

) else if %option% EQU 42 (

    goto TurnonReal-timeprotection

) else if %option% EQU 43 (

    goto TurnonWindowsDefenderSmartScreen

) else if %option% EQU 44 (

    goto TurnonMediaSharing

) else if %option% EQU 45 (

    goto Menu

) else (

    goto EnableTweaks

)

:: ------------------------------------------------------------------------------------



:TurnonCortana

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffCortana

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonCortanaabovelockscreen

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffCortanaabovelockscreen

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonsearchandCortanauselocation

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowSearchToUseLocation" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffsearchandCortanauselocation

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowSearchToUseLocation" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonsuggestedappsinWindowsInkWorkspace

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowSuggestedAppsInWindowsInkWorkspace" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffsuggestedappsinWindowsInkWorkspace

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowSuggestedAppsInWindowsInkWorkspace" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonWindowsInkWorkspace

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowWindowsInkWorkspace" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffWindowsInkWorkspace

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowWindowsInkWorkspace" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Donotallowwebsearch

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Allowwebsearch

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:DonotshowWindowstips

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:ShowWindowstips

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonNotifyfordownloadandautoinstall

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "AUOptions" /t REG_DWORD /d 2 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "ScheduledInstallDay" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "ScheduledInstallTime" /t REG_DWORD /d 3 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.WindowsUpdate.Notification" /v "Enabled" /t REG_DWORD /d 0 /f

takeown /f MusNotification.exe

takeown /f MusNotificationUx.exe

icacls MusNotification.exe /grant %username%:F

icacls MusNotificationUx.exe /grant %username%:F

rename MusNotification.exe MusNotification_backup.exe

rename MusNotificationUx.exe MusNotificationUx_backup.exe

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffNotifyfordownloadandautoinstall

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.WindowsUpdate.Notification" /f

takeown /f MusNotification_backup.exe

takeown /f MusNotificationUx_backup.exe

icacls MusNotification_backup.exe /grant %username%:F

icacls MusNotificationUx_backup.exe /grant %username%:F

rename MusNotification_backup.exe MusNotification.exe

rename MusNotificationUx_backup.exe MusNotificationUx.exe

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:RemovesActionCenter

cls

reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /t REG_DWORD /d 1 /f

taskkill /f /im explorer.exe

explorer.exe

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonActionCenter

cls

reg delete "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /f

taskkill /f /im explorer.exe

explorer.exe

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Enableshowfirstsign-inanimation

cls

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableFirstLogonAnimation" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Disableshowfirstsign-inanimation

cls

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableFirstLogonAnimation" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffAutoplay

cls

net stop PlugPlay

reg add "HKLM\SYSTEM\CurrentControlSet\Services\PlugPlay" /v "DelayedAutoStart" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 0x00000FF /f

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 0x00000FF /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AutoPlay" /v Enabled /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonAutoplay

cls

net start PlugPlay

reg add "HKLM\SYSTEM\CurrentControlSet\Services\PlugPlay" /v "DelayedAutoStart" /t REG_DWORD /d 1 /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f

reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AutoPlay" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnofflocation

cls

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "Value" /t REG_SZ /d "Deny" /f

reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "SensorPermissionState" /t REG_DWORD /d 0 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" /v "Status" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnonlocation

cls

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "Value" /t REG_SZ /d "Allow" /f

reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "SensorPermissionState" /t REG_DWORD /d 1 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" /v "Status" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffOneDrive

cls

taskkill /f /im OneDrive.exe

reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableFileSyncNGSC" /t REG_DWORD /d 1 /f

reg add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0 /f

reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0 /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonOneDrive

cls

reg delete "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /f

reg add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 1 /f

reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /t REG_SZ /d ""C:\Users\%USERNAME%\AppData\Local\Microsoft\OneDrive\OneDrive.exe" /background" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnoffautoinstallsuggestapps

cls

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnonautoinstallsuggestapps

cls

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 1 /f

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffMicrosoftconsumerexperiences

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonMicrosoftconsumerexperiences

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnoffappsdownloadandinstallupdate

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /t REG_DWORD /d 2 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnonappsdownloadandinstallupdate

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnofftheStoreapplication

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /t REG_DWORD /d 1 /f

reg add "HKCU\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnontheStoreapplication

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /f

reg delete "HKCU\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffAutomaticMaintenance

cls

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" /v "MaintenanceDisabled" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonAutomaticMaintenance

cls

reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" /v "MaintenanceDisabled" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonWindowsDefenderAntivirus

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "SettingsPageVisibility" /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /t REG_EXPAND_SZ /d "%ProgramFiles%\Windows Defender\MSASCuiL.exe" /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "DelayedAutoStart" /t REG_DWORD /d 1 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d 2 /f

net start SecurityHealthService

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

echo.After windows is restarted, open Start menu run Windows Defender Security Center icon

echo.and go to C:\Program Files\Windows Defender run MSASCuiL.exe

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto EnableTweaks

:: --------------------------------------------------



:TurnoffWindowsDefenderAntivirus

cls

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /v "Enabled" /t REG_DWORD /d 0 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "DelayedAutoStart" /t REG_DWORD /d 0 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d 3 /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "SettingsPageVisibility" /t REG_SZ /d "hide:windowsdefender" /f

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto EnableTweaks

:: --------------------------------------------------



:TurnonReal-timeprotection

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffReal-timeprotection

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /v "Enabled" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonWindowsDefenderSmartScreen

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge" /f

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffWindowsDefenderSmartScreen

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter" /v "EnabledV9" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableSmartScreen" /t REG_DWORD /d 0 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /v "Enabled" /t REG_DWORD /d 0 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonMediaSharing

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffMediaSharing

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" /v "PreventLibrarySharing" /t REG_DWORD /d 1 /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:: /*************************************************************************************/





:: Backup Drivers.

:: /*************************************************************************************/

:BackupDrivers



cls

md DriversBackup

Dism /Online /Export-Driver /Destination:%~dp0\DriversBackup

cls

echo.The operation completed successfully.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Disk Cleanup.

:: /*************************************************************************************/

:DiskCleanup



cls

DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

cls

echo.The operation completed successfully.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: System Restore.

:: /*************************************************************************************/

:SystemRestore



cls

echo.System Restore

echo.

echo. ID Option

echo.

echo. 1 Create a restore point

echo. 2 Restore Windows if you created a restore point

echo. 3 Return Main menu

echo.

choice /c:123 /n /m "Select ID for Continue : "



if %errorlevel% EQU 1 goto Checkpoint-Computer

if %errorlevel% EQU 2 goto Restore-Computer

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Checkpoint-Computer

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Checkpoint-Computer.ps1'"

cls

echo.The operation completed successfully.

pause

goto Menu

:: --------------------------------------------------



:Restore-Computer

cls

echo.WARNING: The Computer needs to reboot and take some time to complete this process.

choice /c YN /n /m "Are you sure? (Y/N): "

if %errorlevel% EQU 1 powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Restore-Computer.ps1'"

if %errorlevel% EQU 2 goto Menu

cls

echo.The operation completed successfully.

echo.Restart Windows to complete this operation.

choice /c YN /n /m "Do you want to restart the computer now? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Uninstall Software.

:: /*************************************************************************************/

:UninstallSoftware

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-InstalledSoftwares.ps1'"

cls

echo.The operation completed successfully.

choice /c YN /n /m "Do you want to continue Uninstall Software program? (Yes/No) "

if %errorlevel% EQU 1 goto UninstallSoftware

if %errorlevel% EQU 2 goto Menu

:: --------------------------------------------------



:: /*************************************************************************************/





:: Exit the program.

:: /*************************************************************************************/

:Exitprogram

cls

echo.The program will be closed after 15 seconds.

echo.Thank you for using the program.

echo.Any details please contact me through: fb.com/kequaduongvodanh

echo.Goodbye and see you again!

timeout /t 15 /nobreak

exit

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Restart the computer.

:: /*************************************************************************************/

:Restart



cls

echo.Windows will be restarted after 15 seconds.

echo.Thank you for using the program.

echo.Any details please contact me through: fb.com/kequaduongvodanh

echo.Goodbye and see you again!

timeout /t 15 /nobreak

shutdown /r /f /t 00

:: --------------------------------------------------



:: /*************************************************************************************/

Code tiếng Việt

:: Name     : RemoveAppxPackageTool.cmd

:: Author   : Nguyen Tuan.

:: Website  : www.blogthuthuatwin10.com



chcp 65001 >nul

@echo off

title RemoveAppxPackageTool

color 3f

chcp 65001 >nul

cd /d %~dp0

cls

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if "%errorlevel%" NEQ "0" (

 echo: Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"

 echo: UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

 "%temp%\getadmin.vbs" & exit

)

if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"



:: Menu of tool.

:: /*************************************************************************************/

:Menu

cls

echo.Menu chính

echo.



echo. ID Tùy chọn

echo.

echo. 1 Xem danh sách ứng dụng

echo. 2 Gỡ bỏ ứng dụng

echo. 3 Thêm ứng dụng

echo. 4 Xem danh sách gói cài đặt ứng dụng

echo. 5 Gỡ bỏ gói cài đặt ứng dụng

echo. 6 Gỡ bỏ gói tính năng hệ thống

echo. 7 Bật tính năng của Windows

echo. 8 Tắt tính năng của Windows

echo. 9 Bật Service

echo. 10 Tắt Service

echo. 11 Tùy chỉnh

echo. 12 Sao lưu drivers

echo. 13 Dọn dẹp ổ đĩa hệ thống

echo. 14 Sao lưu - Phục hồi

echo. 15 Gỡ cài đặt phần mềm

echo. 16 Thoát chương trình

echo. 17 Khởi động máy tính

echo.

set /p option=Chọn ID và nhấn Enter :

if %option% EQU 1 (

    goto Get-AppxPackage

) else if %option% EQU 2 (

    goto Remove-AppxPackage

) else if %option% EQU 3 (

    goto Add-AppxPackage

) else if %option% EQU 4 (

    goto Get-AppxProvisionedPackage

) else if %option% EQU 5 (

    goto Remove-AppxProvisionedPackage

) else if %option% EQU 6 (

    goto Version

) else if %option% EQU 7 (

    goto Enable-WindowsOptionalFeature

) else if %option% EQU 8 (

    goto Disable-WindowsOptionalFeature

) else if %option% EQU 9 (

    goto Start-Service

) else if %option% EQU 10 (

    goto Stop-Service

) else if %option% EQU 11 (

    goto EnableTweaks

) else if %option% EQU 12 (

    goto BackupDrivers

) else if %option% EQU 13 (

    goto DiskCleanup

) else if %option% EQU 14 (

    goto SystemRestore

) else if %option% EQU 15 (

    goto UninstallSoftware

) else if %option% EQU 16 (

    goto Exitprogram

) else if %option% EQU 17 (

    goto Restart

) else (

    goto Menu

)

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Get-AppxPackage.

:: /*************************************************************************************/

:Get-AppxPackage

cls

echo.Bạn mốn xem danh sách ứng dụng cho tài khoản hiện tại hay tất cả tài khoản?

choice /c EAM /n /m "Nhấn E cho tài khoản hiện tại, A cho tất cả tài khoản, M để quay về Menu chính: "

if %errorlevel% EQU 1 goto Currentuser

if %errorlevel% EQU 2 goto Allusers

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Currentuser

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Get-AppxPackage.ps1'"

cls

goto Menu

:: ------------------------------------------------------------------------------------



:Allusers

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Get-AppxPackageAll.ps1'"

cls

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Remove-AppxPackage.

:: /*************************************************************************************/

:Remove-AppxPackage

cls

echo.Bạn muốn gỡ bỏ một hay tất cả ứng dụng?

choice /c EAM /n /m "Nhấn E cho mỗi ứng dụng, A cho tất cả, M để quay về Menu chính: "

if %errorlevel% EQU 1 goto Removeeachapp

if %errorlevel% EQU 2 goto Removeallapps

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Removeeachapp

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxPackage.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục gỡ bỏ ứng dụng? (Yes/No) "

if %errorlevel% EQU 1 goto Removeeachapp

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:Removeallapps

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxPackageAll.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Add-AppxPackage.

:: /*************************************************************************************/

:Add-AppxPackage

cls

echo.Bạn muốn thêm một hay tất cả ứng dụng?

choice /c EAM /n /m "Nhấn E cho mỗi ứng dụng, A cho tất cả, M để quay về Menu chính: "

if %errorlevel% EQU 1 goto Addeachapp

if %errorlevel% EQU 2 goto Addallapps

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Addeachapp

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Add-AppxPackage.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục thêm ứng dụng? (Yes/No) "

if %errorlevel% EQU 1 goto Addeachapp

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:Addallapps

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Add-AppxPackageAll.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Get-AppxProvisionedPackage.

:: /*************************************************************************************/

:Get-AppxProvisionedPackage

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Get-AppxProvisionedPackage.ps1'"

cls

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Remove-AppxProvisionedPackage.

:: /*************************************************************************************/

:Remove-AppxProvisionedPackage

cls

echo.Bạn muốn gỡ bỏ một hay tất cả gói cài đặt ứng dụng?

choice /c EAM /n /m "Nhấn E cho mỗi gói cài đặt ứng dụng, A cho tất cả, M để quay về Menu chính: "

if %errorlevel% EQU 1 goto Removeeachpackage

if %errorlevel% EQU 2 goto Removeallpackages

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Removeeachpackage

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxProvisionedPackage.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục gỡ bỏ gói cài đặt ứng dụng? (Yes/No) "

if %errorlevel% EQU 1 goto Removeeachpackage

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:Removeallpackages

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-AppxProvisionedPackageAll.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Checking Version.

:: /*************************************************************************************/

:Version

cls

ver | findstr /i "10\.0\.10240"

if %ERRORLEVEL% EQU 0 (

echo.Máy tính bạn đang chạy Windows 10, Version 1507.

echo.Tùy chọn này chỉ được hỗ trợ cho Windows 10, Version 1703.

pause

goto Menu

)

ver | findstr /i "10\.0\.10586"

if %ERRORLEVEL% EQU 0 (

echo Máy tính bạn đang chạy Windows 10, Version 1511.

echo.Tùy chọn này chỉ được hỗ trợ cho Windows 10, Version 1703.

pause

goto Menu

)

ver | findstr /i "10\.0\.14393"

if %ERRORLEVEL% EQU 0 (

echo Máy tính bạn đang chạy Windows 10, Version 1607.

echo.Tùy chọn này chỉ được hỗ trợ cho Windows 10, Version 1703.

pause

goto Menu

)

ver | findstr /i "10\.0\.15063"

if %ERRORLEVEL% EQU 0 (

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

copy data\amd64\SetACL.exe C:\Windows\System32\SetACL.exe

) ELSE (

copy data\x86\SetACL.exe C:\Windows\System32\SetACL.exe

)

set Packages=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages

SetACL -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" -ot reg -actn setowner -ownr "n:%USERDOMAIN%\%USERNAME%"

SetACL -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" -ot reg -actn ace -ace "n:%USERDOMAIN%\%USERNAME%;p:full"

goto Remove-Package

)

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Remove-Package.

:: /*************************************************************************************/

:Remove-Package

cls

echo.Gỡ bỏ gói tính năng hệ thống

echo.

echo.ID Tùy chọn  ID Tùy chọn

echo.

echo.1 Connect   19 Media Features     

echo.2 Cortana   20 Microsoft Message Queue (MSMQ) Server

echo.3 Get Help  21 Microsoft Print to PDF  

echo.4 Microsoft Edge  22 MultiPoint Connector  

echo.5 Mixed Reality Portal 23 Print and Document Services 

echo.6 OneDrive  24 RAS Connection Manager Adminitration Kit (CMAK)  

echo.7 Quick Assist  25 Remove Differential Compression API Support  

echo.8 Windows Defender 26 RIP Listener 

echo.9 Windows Spotlight 27 Services for NFS

echo.10 Windows Photo Viewer 28 Simple Network Management Protocol (SNMP)

echo.11 Snipping Tool  29 Simple TCPIP services (i.e. echo daytime etc) 

echo.12 Active Directory 30 SMB 1.0/CIFS File Sharing Support   

echo.13 Containers  31 Telnet-TFTP Client   

echo.14 Assigned Access  32 Windows Identify Foundation 3.5

echo.15 Device Lockdown  33 Windows Powershell 2.0 

echo.16 Hyper-V   34 Windows TIFF IFilter       

echo.17 Internet Explorer 35 XPS Services 

echo.18 Legacy Components 36 XPS Viewer

echo.

echo.37 Về Menu chính

echo.    



set /p option=Chọn ID và nhấn Enter :

if %option% EQU 1 (

    call :Connect

) else if %option% EQU 2 (

    call :Cortana

) else if %option% EQU 3 (

    call :GetHelp

) else if %option% EQU 4 (

    goto MicrosoftEdge

) else if %option% EQU 5 (

    goto MixedRealityPortal

) else if %option% EQU 6 (

    goto OneDrive

) else if %option% EQU 7 (

    goto QuickAssist

) else if %option% EQU 8 (

    goto WindowsDefender

) else if %option% EQU 9 (

    goto WindowsSpotlight

) else if %option% EQU 10 (

    goto PhotoViewer

) else if %option% EQU 11 (

    goto SnippingTool

) else if %option% EQU 12 (

    goto ActiveDirectory

) else if %option% EQU 13 (

    goto Containers

) else if %option% EQU 14 (

    goto AssignedAccess

) else if %option% EQU 15 (

    goto DeviceLockdown

) else if %option% EQU 16 (

    goto Hyper-V

) else if %option% EQU 17 (

    goto InternetExplorer11

) else if %option% EQU 18 (

    goto LegacyComponents

) else if %option% EQU 19 (

    goto MediaFeatures

) else if %option% EQU 20 (

    goto MessageQueue

) else if %option% EQU 21 (

    goto PrinttoPDF

) else if %option% EQU 22 (

    goto MultiPointConnector

) else if %option% EQU 23 (

    goto PrintandDocument

) else if %option% EQU 24 (

    goto RASConnectionManager

) else if %option% EQU 25 (

    goto DifferentialCompressionAPI

) else if %option% EQU 26 (

    goto RIPListener

) else if %option% EQU 27 (

    goto ServicesforNFS

) else if %option% EQU 28 (

    goto SimpleNetwork

) else if %option% EQU 29 (

    goto SimpleTCPIP

) else if %option% EQU 30 (

    goto FileSharingSupport

) else if %option% EQU 31 (

    goto TelnetClient

) else if %option% EQU 32 (

    goto IdentifyFoundation

) else if %option% EQU 33 (

    goto Powershell2.0

) else if %option% EQU 34 (

    goto TIFFIFilter

) else if %option% EQU 35 (

    goto XPSServices

) else if %option% EQU 36 (

    goto XPSViewer

) else if %option% EQU 37 (

    goto Menu

) else (

    goto Remove-Package

)

:: ------------------------------------------------------------------------------------



:Connect

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Connect

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Connect

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-PPIProjection-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-PPIProjection-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-PPIProjection-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-PPIProjection-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:Cortana

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Cortana

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Cortana

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Cortana-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Cortana-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /Remove-Package /packagename:Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Cortana-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Cortana-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /Remove-Package /packagename:Microsoft-Windows-Cortana-PAL-Desktop-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

: ------------------------------------------------------------------------------------



:GetHelp

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-ContactSupport

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-ContactSupport

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContactSupport-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:MicrosoftEdge

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MicrosoftEdge

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MicrosoftEdge

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Internet-Browser-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:MixedRealityPortal

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MixedRealityPortal

if %errorlevel% EQU 2 goto Menu

: --------------------------------------------------



:Remove-MixedRealityPortal

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-WOW64-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Holographic-Desktop-Merged-WOW64-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-WOW64-analog-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Holographic-Desktop-Merged-WOW64-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy"

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy" /grant %username%:F

rd /s /q "%SystemRoot%\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy"

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

) ELSE (

cls

echo.Máy tính đang cài đặt Windows phiên bản 32-bit, Ứng dụng này chỉ có trong phiên bản 64-bit.

pause

goto Remove-Package

)

: ------------------------------------------------------------------------------------



:OneDrive

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-OneDrive

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-OneDrive

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

taskkill /f /im OneDrive.exe

start /wait %systemroot%\SysWOW64\OneDriveSetup.exe /uninstall

reg delete "%Packages%\Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

reg delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

taskkill /f /im OneDrive.exe

start /wait %systemroot%\System32\OneDriveSetup.exe /uninstall

reg delete "%Packages%\Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneDrive-Setup-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:QuickAssist

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-QuickAssist

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-QuickAssist

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-QuickAssist-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

: ------------------------------------------------------------------------------------



:WindowsDefender

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-WindowsDefender

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-WindowsDefender

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v SettingsPageVisibility /t REG_SZ /d "hide:windowsdefender" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance" /v Enabled /t REG_DWORD /d 0 /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SecurityHealth /f

reg delete "%Packages%\Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Group-Policy-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Shield-Provider-Core-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Group-Policy-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Shield-Provider-Core-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris"

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris" /grant %username%:F

rd /s /q "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

) ELSE (

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v SettingsPageVisibility /t REG_SZ /d "hide:windowsdefender" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance" /v Enabled /t REG_DWORD /d 0 /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SecurityHealth /f

reg delete "%Packages%\Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Defender-Group-Policy-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Windows-Shield-Provider-Core-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Windows-Defender-AM-Default-Definitions-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-amcore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-AppLayer-Group-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-ApplicationGuard-Inbox-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Defender-Group-Policy-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Windows-Shield-Provider-Core-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets"

takeown /f "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris"

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\Assets" /grant %username%:F

icacls "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\pris" /grant %username%:F

rd /s /q "%SystemRoot%\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy"

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Hướng dẫn xóa biểu tượng Windows Defender Security Center trong Start menu.

echo Xem chi tiết tại địa chỉ https://goo.gl/8HtNsc

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:WindowsSpotlight

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-WindowsSpotlight

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-WindowsSpotlight

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-ContentDeliveryManager-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:PhotoViewer

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-PhotoViewer

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-PhotoViewer

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PhotoBasicPackage~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:SnippingTool

cls

choice /c YN /n /m "CẢNH BÁO: Ứng dụng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-SnippingTool

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-SnippingTool

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SnippingTool-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:ActiveDirectory

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-ActiveDirectory

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-ActiveDirectory

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-DirectoryServices-ADAM-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:Containers

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Containers

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Containers

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-OneCore-Containers-Opt-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:AssignedAccess

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-AssignedAccess

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-AssignedAccess

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-base-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-AssignedAccess-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:DeviceLockdown

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-DeviceLockdown

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-DeviceLockdown

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-BootExp-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-EmbeddedLogon-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-KeyboardFilter-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-base-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Embedded-UnifiedWriteFilter-Merged-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-EmbeddedExp-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Client-ShellLauncher-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:Hyper-V

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Hyper-V

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Hyper-V

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KMCL-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-HvSocket-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KMCL-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-HvSocket-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KMCL-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Shutdown-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-TimeSync-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Guest-VmBus-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-HvSocket-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:HyperV-Guest-DynamicMemory-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Heartbeat-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-IcSvcExt-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KMCL-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-KvpExchange-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-Emulated-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Networking-SrIov-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-onecoreuap-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-RemoteFx-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Shutdown-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Filter-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-Storage-Synthetic-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-TimeSync-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Guest-VmBus-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-HvSocket-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:HyperV-Storage-VHD-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Hyper-V-ClientEdition-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-onecore-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-HyperV-Guest-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:InternetExplorer11

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-InternetExplorer11

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-InternetExplorer11

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~~11.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~amd64~~11.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~~11.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~amd64~~11.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~x86~~11.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~x86~~11.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~x86~~11.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-InternetExplorer-Package~31bf3856ad364e35~x86~~11.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:LegacyComponents

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-LegacyComponents

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-LegacyComponents

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Legacy-Components-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:MediaFeatures

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MediaFeatures

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MediaFeatures

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MediaPlayback-OC-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:MessageQueue

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MessageQueue

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MessageQueue

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-COM-MSMQ-package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-MSMQ-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:PrinttoPDF

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-PrinttoPDF

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-PrinttoPDF

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PrintToPDFServices-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:MultiPointConnector

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-MultiPointConnector

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-MultiPointConnector

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-MultiPoint-Connector-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:PrintandDocument

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-PrintandDocument

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-PrintandDocument

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printer-Drivers-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Enterprise-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-LocalPrinting-Home-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-Printing-PremiumTools-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Remove-Package

:: ------------------------------------------------------------------------------------



:RASConnectionManager

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-RASConnectionManager

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-RASConnectionManager

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasCMAK-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:DifferentialCompressionAPI

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-DifferentialCompressionAPI

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-DifferentialCompressionAPI

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-RDC-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RDC-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-RDC-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RDC-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:RIPListener

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-RIPListener

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-RIPListener

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-RasRip-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasRip-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-RasRip-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-RasRip-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:ServicesforNFS

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-ServicesforNFS

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-ServicesforNFS

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-NFS-ClientSKU-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:SimpleNetwork

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-SimpleNetwork

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-SimpleNetwork

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SNMP-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SNMP-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SNMP-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SNMP-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-WMI-SNMP-Provider-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:SimpleTCPIP

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-SimpleTCPIP

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-SimpleTCPIP

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SimpleTCP-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:FileSharingSupport

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-FileSharingSupport

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-FileSharingSupport

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-SMB1-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SMB1-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-SMB1-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-SMB1-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:TelnetClient

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-TelnetClient

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-TelnetClient

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

reg delete "%Packages%\Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Telnet-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

dism /online /remove-package /packagename:Microsoft-Windows-TFTP-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:IdentifyFoundation

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-IdentifyFoundation

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-IdentifyFoundation

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Identity-Foundation-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:Powershell2.0

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-Powershell2.0

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-Powershell2.0

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-PowerShell-V2-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:TIFFIFilter

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-TIFFIFilter

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-TIFFIFilter

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-WinOcr-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:XPSServices

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-XPSServices

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-XPSServices

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Printing-XPSServices-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:XPSViewer

cls

choice /c YN /n /m "CẢNH BÁO: Tính năng này không thể cài đặt lại được nếu bị gỡ bỏ. Bạn có chắc không? (Yes/No) "

if %errorlevel% EQU 1 goto Remove-XPSViewer

if %errorlevel% EQU 2 goto Remove-Package

: --------------------------------------------------



:Remove-XPSViewer

cls

IF %PROCESSOR_ARCHITECTURE% == AMD64 (

reg delete "%Packages%\Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~amd64~~10.0.15063.0 /norestart

) ELSE (

reg delete "%Packages%\Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0\Owners" /f

dism /online /remove-package /packagename:Microsoft-Windows-Xps-Foundation-Client-Package~31bf3856ad364e35~x86~~10.0.15063.0 /norestart

)

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Remove-Package

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Enable-WindowsOptionalFeature.

:: /*************************************************************************************/

:Enable-WindowsOptionalFeature

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Enable-WindowsOptionalFeature.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục bật tính năng của Windows? (Yes/No) "

if %errorlevel% EQU 1 goto Enable-WindowsOptionalFeature

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Disable-WindowsOptionalFeature.

:: /*************************************************************************************/

:Disable-WindowsOptionalFeature

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Disable-WindowsOptionalFeature.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục tắt tính năng của Windows? (Yes/No) "

if %errorlevel% EQU 1 goto Disable-WindowsOptionalFeature

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Start-Service.

:: /*************************************************************************************/

:Start-Service

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Start-Service.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục bật service? (Yes/No) "

if %errorlevel% EQU 1 goto Start-Service

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Stop-Service.

:: /*************************************************************************************/

:Stop-Service

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Stop-Service.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục tắt service? (Yes/No) "

if %errorlevel% EQU 1 goto Stop-Service

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/



:: Enable Tweaks.

:: /*************************************************************************************/

:EnableTweaks

cls

echo.Tùy chỉnh

echo.

echo. Tùy chọn      Bật Tắt

echo.

echo. Cho phép Cortana     1 23 

echo. Cho phép Cortana ngoài màn hình khóa   2 24 

echo. Cho phép tìm kiếm và Cortana sử dụng vị trí  3 25 

echo. Cho phép ứng dụng được đề xuất trong Windows Ink  4  26

echo. Cho phép Windows Ink Workspace    5 27

echo. Không cho phép tìm kiếm web    6 28

echo. Không chỉ mẹo Windows     7 29

echo. Thông báo cho tải xuống và tự động cài đặt cập nhật 8 30

echo. Loại bỏ trung tâm thông báo Action Center  9 31

echo. Hiển thị hoạt họa đăng nhập đầu tiên   10 32 

echo. Tắt Autoplay      11 33 

echo. Tắt vị trí      12 34

echo. Tắt OneDrive      13 35

echo. Tắt tự động cài đặt ứng dụng được đề xuất   14  36  

echo. Tắt Microsoft consumer experiences   15 37

echo. Tắt ứng dụng tự tải và cài đặt cập nhật trong Store 16 38

echo. Tắt ứng dụng Store      17 39

echo. Tắt tự động bảo trì hệ thống    18 40

echo. Tắt Windows Defender Antivirus    19 41

echo. Tắt bảo vệ thời gian thực    20 42

echo. Tắt bộ lọc Windows Defender    21 43

echo. Tắt Media Sharing     22 44

echo. 

echo. Về Menu chính (45)

echo.



set /p option=Chọn ID và nhấn Enter :

if %option% EQU 1 (

    goto TurnonCortana

) else if %option% EQU 2 (

    goto TurnonCortanaabovelockscreen

) else if %option% EQU 3 (

    goto TurnonsearchandCortanauselocation

) else if %option% EQU 4 (

    goto TurnonsuggestedappsinWindowsInkWorkspace

) else if %option% EQU 5 (

    goto TurnonWindowsInkWorkspace

) else if %option% EQU 6 (

    goto Donotallowwebsearch

) else if %option% EQU 7 (

    goto DonotshowWindowstips

) else if %option% EQU 8 (

    goto TurnonNotifyfordownloadandautoinstall

) else if %option% EQU 9 (

    goto RemovesActionCenter

) else if %option% EQU 10 (

    goto Enableshowfirstsign-inanimation

) else if %option% EQU 11 (

    goto TurnoffAutoplay

) else if %option% EQU 12 (

    goto Turnofflocation

) else if %option% EQU 13 (

    goto TurnoffOneDrive

) else if %option% EQU 14 (

    goto Turnoffautoinstallsuggestapps

) else if %option% EQU 15 (

    goto TurnoffMicrosoftconsumerexperiences

) else if %option% EQU 16 (

    goto Turnoffappsdownloadandinstallupdate

) else if %option% EQU 17 (

    goto TurnofftheStoreapplication

) else if %option% EQU 18 (

    goto TurnoffAutomaticMaintenance

) else if %option% EQU 19 (

    goto TurnoffWindowsDefenderAntivirus

) else if %option% EQU 20 (

    goto TurnoffReal-timeprotection

) else if %option% EQU 21 (

    goto TurnoffWindowsDefenderSmartScreen

) else if %option% EQU 22 (

    goto TurnoffMediaSharing

) else if %option% EQU 23 (

    goto TurnoffCortana

) else if %option% EQU 24 (

    goto TurnoffCortanaabovelockscreen

) else if %option% EQU 25 (

    goto TurnoffsearchandCortanauselocation

) else if %option% EQU 26 (

    goto TurnoffsuggestedappsinWindowsInkWorkspace

) else if %option% EQU 27 (

    goto TurnoffWindowsInkWorkspace

) else if %option% EQU 28 (

    goto Allowwebsearch

) else if %option% EQU 29 (

    goto ShowWindowstips

) else if %option% EQU 30 (

    goto TurnoffNotifyfordownloadandautoinstall

) else if %option% EQU 31 (

    goto TurnonActionCenter

) else if %option% EQU 32 (

    goto Disableshowfirstsign-inanimation

) else if %option% EQU 33 (

    goto TurnonAutoplay

) else if %option% EQU 34 (

    goto Turnonlocation

) else if %option% EQU 35 (

    goto TurnonOneDrive

) else if %option% EQU 36 (

    goto Turnonautoinstallsuggestapps

) else if %option% EQU 37 (

    goto TurnonMicrosoftconsumerexperiences

) else if %option% EQU 38 (

    goto Turnonappsdownloadandinstallupdate

) else if %option% EQU 39 (

    goto TurnontheStoreapplication

) else if %option% EQU 40 (

    goto TurnonAutomaticMaintenance

) else if %option% EQU 41 (

    goto TurnonWindowsDefenderAntivirus

) else if %option% EQU 42 (

    goto TurnonReal-timeprotection

) else if %option% EQU 43 (

    goto TurnonWindowsDefenderSmartScreen

) else if %option% EQU 44 (

    goto TurnonMediaSharing

) else if %option% EQU 45 (

    goto Menu

) else (

    goto EnableTweaks

)

:: ------------------------------------------------------------------------------------



:TurnonCortana

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /f

cls

echo.The operation completed successfully.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffCortana

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonCortanaabovelockscreen

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffCortanaabovelockscreen

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortanaAboveLock" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonsearchandCortanauselocation

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowSearchToUseLocation" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffsearchandCortanauselocation

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowSearchToUseLocation" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonsuggestedappsinWindowsInkWorkspace

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowSuggestedAppsInWindowsInkWorkspace" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffsuggestedappsinWindowsInkWorkspace

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowSuggestedAppsInWindowsInkWorkspace" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonWindowsInkWorkspace

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowWindowsInkWorkspace" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffWindowsInkWorkspace

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" /v "AllowWindowsInkWorkspace" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Donotallowwebsearch

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Allowwebsearch

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:DonotshowWindowstips

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:ShowWindowstips

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonNotifyfordownloadandautoinstall

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "AUOptions" /t REG_DWORD /d 2 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "ScheduledInstallDay" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "ScheduledInstallTime" /t REG_DWORD /d 3 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.WindowsUpdate.Notification" /v "Enabled" /t REG_DWORD /d 0 /f

takeown /f MusNotification.exe

takeown /f MusNotificationUx.exe

icacls MusNotification.exe /grant %username%:F

icacls MusNotificationUx.exe /grant %username%:F

rename MusNotification.exe MusNotification_backup.exe

rename MusNotificationUx.exe MusNotificationUx_backup.exe

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffNotifyfordownloadandautoinstall

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.WindowsUpdate.Notification" /f

takeown /f MusNotification_backup.exe

takeown /f MusNotificationUx_backup.exe

icacls MusNotification_backup.exe /grant %username%:F

icacls MusNotificationUx_backup.exe /grant %username%:F

rename MusNotification_backup.exe MusNotification.exe

rename MusNotificationUx_backup.exe MusNotificationUx.exe

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:RemovesActionCenter

cls

reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /t REG_DWORD /d 1 /f

taskkill /f /im explorer.exe

explorer.exe

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonActionCenter

cls

reg delete "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /f

taskkill /f /im explorer.exe

explorer.exe

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Enableshowfirstsign-inanimation

cls

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableFirstLogonAnimation" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Disableshowfirstsign-inanimation

cls

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableFirstLogonAnimation" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffAutoplay

cls

net stop PlugPlay

reg add "HKLM\SYSTEM\CurrentControlSet\Services\PlugPlay" /v "DelayedAutoStart" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 0x00000FF /f

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 0x00000FF /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AutoPlay" /v Enabled /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonAutoplay

cls

net start PlugPlay

reg add "HKLM\SYSTEM\CurrentControlSet\Services\PlugPlay" /v "DelayedAutoStart" /t REG_DWORD /d 1 /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f

reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AutoPlay" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnofflocation

cls

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "Value" /t REG_SZ /d "Deny" /f

reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "SensorPermissionState" /t REG_DWORD /d 0 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" /v "Status" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnonlocation

cls

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "Value" /t REG_SZ /d "Allow" /f

reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Permissions\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "SensorPermissionState" /t REG_DWORD /d 1 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" /v "Status" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffOneDrive

cls

taskkill /f /im OneDrive.exe

reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableFileSyncNGSC" /t REG_DWORD /d 1 /f

reg add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0 /f

reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0 /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonOneDrive

cls

reg delete "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /f

reg add "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 1 /f

reg add "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /t REG_SZ /d ""C:\Users\%USERNAME%\AppData\Local\Microsoft\OneDrive\OneDrive.exe" /background" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnoffautoinstallsuggestapps

cls

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnonautoinstallsuggestapps

cls

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 1 /f

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffMicrosoftconsumerexperiences

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonMicrosoftconsumerexperiences

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnoffappsdownloadandinstallupdate

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /t REG_DWORD /d 2 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:Turnonappsdownloadandinstallupdate

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnofftheStoreapplication

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /t REG_DWORD /d 1 /f

reg add "HKCU\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnontheStoreapplication

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /f

reg delete "HKCU\SOFTWARE\Policies\Microsoft\WindowsStore" /v "RemoveWindowsStore" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffAutomaticMaintenance

cls

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" /v "MaintenanceDisabled" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonAutomaticMaintenance

cls

reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" /v "MaintenanceDisabled" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonWindowsDefenderAntivirus

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /f

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "SettingsPageVisibility" /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /t REG_EXPAND_SZ /d "%ProgramFiles%\Windows Defender\MSASCuiL.exe" /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "DelayedAutoStart" /t REG_DWORD /d 1 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d 2 /f

net start SecurityHealthService

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

echo.Sau khi Windows khởi động lại, mở Start menu click vào biểu tượng Windows Defender Security Center

echo.và truy cập đường dẫn C:\Program Files\Windows Defender chạy file MSASCuiL.exe

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto EnableTweaks

:: --------------------------------------------------



:TurnoffWindowsDefenderAntivirus

cls

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /v "Enabled" /t REG_DWORD /d 0 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "DelayedAutoStart" /t REG_DWORD /d 0 /f

reg add "HKLM\SYSTEM\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d 3 /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "SettingsPageVisibility" /t REG_SZ /d "hide:windowsdefender" /f

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto EnableTweaks

:: --------------------------------------------------



:TurnonReal-timeprotection

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffReal-timeprotection

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d 1 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /v "Enabled" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonWindowsDefenderSmartScreen

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge" /f

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffWindowsDefenderSmartScreen

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter" /v "EnabledV9" /t REG_DWORD /d 0 /f

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableSmartScreen" /t REG_DWORD /d 0 /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" /v "Enabled" /t REG_DWORD /d 0 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnonMediaSharing

cls

reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:TurnoffMediaSharing

cls

reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" /v "PreventLibrarySharing" /t REG_DWORD /d 1 /f

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto EnableTweaks

:: --------------------------------------------------



:: /*************************************************************************************/





:: Backup Drivers.

:: /*************************************************************************************/

:BackupDrivers



cls

md DriversBackup

Dism /Online /Export-Driver /Destination:%~dp0\DriversBackup

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: Disk Cleanup.

:: /*************************************************************************************/

:DiskCleanup



cls

DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/





:: System Restore.

:: /*************************************************************************************/

:SystemRestore



cls

echo.Sao lưu - Phục hồi

echo.

echo. ID Tùy chọn

echo.

echo. 1 Tạo một điểm khôi phục hệ thống

echo. 2 Phục hồi Windows nếu như bạn đã tạo một điểm khôi phục hệ thống

echo. 3 Về Menu chính

echo.

choice /c:123 /n /m "Chọn ID để tiếp tục : "



if %errorlevel% EQU 1 goto Checkpoint-Computer

if %errorlevel% EQU 2 goto Restore-Computer

if %errorlevel% EQU 3 goto Menu

:: --------------------------------------------------



:Checkpoint-Computer

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Checkpoint-Computer.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

pause

goto Menu

:: --------------------------------------------------



:Restore-Computer

cls

echo.CẢNH BÁO: Máy tính cần phải được khởi động và mất một thời gian để hoàn tất

echo.quá trình phục hồi Windows.

choice /c YN /n /m "Bạn có chắc không? (Yes/No): "

if %errorlevel% EQU 1 powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Restore-Computer.ps1'"

if %errorlevel% EQU 2 goto Menu

cls

echo.Hoạt động được hoàn tất thành công.

echo.Windows cần được khởi động lại để hoàn tất hoạt động này.

choice /c YN /n /m "Bạn có muốn khởi động máy tính ngay bây giờ? (Yes/No) "

if %errorlevel% EQU 1 goto Restart

if %errorlevel% EQU 2 goto Menu

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/



:: Uninstall Software.

:: /*************************************************************************************/

:UninstallSoftware

cls

powershell.exe -ExecutionPolicy Bypass -Command "& '%~dp0data\scripts\Remove-InstalledSoftwares.ps1'"

cls

echo.Hoạt động được hoàn tất thành công.

choice /c YN /n /m "Bạn có muốn tiếp tục gỡ cài đặt phần mềm? (Yes/No) "

if %errorlevel% EQU 1 goto UninstallSoftware

if %errorlevel% EQU 2 goto Menu

:: --------------------------------------------------



:: /*************************************************************************************/





:: Exit the program.

:: /*************************************************************************************/

:Exitprogram

cls

echo.Chương trình sẽ tự động tắt sau 15 giây.

echo.Cảm ơn bạn đã sử dụng chương trình.

echo.Mọi thắc mắc vui lòng liên lạc với tôi qua Facebook theo địa chỉ: fb.com/kequaduongvodanh

echo.Tạm biệt và hẹn gặp lại!

timeout /t 15 /nobreak

exit

:: ------------------------------------------------------------------------------------



:: /*************************************************************************************/



:: Restart the computer.

:: /*************************************************************************************/

:Restart



cls

echo.Windows sẽ được khởi động sau 15 giây.

echo.Cảm ơn bạn đã sử dụng chương trình.

echo.Mọi thắc mắc vui lòng liên lạc với tôi qua Facebook theo địa chỉ: fb.com/kequaduongvodanh

echo.Tạm biệt và hẹn gặp lại!

timeout /t 15 /nobreak

shutdown /r /f /t 00

:: --------------------------------------------------



:: /*************************************************************************************/

Khi lưu thành tập tin batch các bạn để tập tin này trong thư mục RemoveAppxPackageTool cùng với thư mục data


Đến đây là bạn có thể chạy được công cụ và sử dụng được. Nếu bạn muốn chuyên nghiệp hơn thì chuyển công cụ có đuôi .cmd sang .exe vì khi chuyển sang định dạng này thì người khác sẽ không xem được nội dụng code cũng như chỉnh sửa được.

2. Chuyển đổi định dạng từ .cmd sang .exe

Tải công cụ chuyển đổi tại đây, bạn có thể cài đặt phần mềm hoặc chạy portable đều được, các bạn để tùy chọn giống như hình dưới đây


Nếu các bạn muốn thay đổi icon cho công cụ và thêm bản quyền thì chuyển qua tab thông tin phiên bản


Khi thực hiện xong bấm chọn Thực thi biên soạn bắt đầu chuyển đổi sang định dạng .exe xong tắt phần mềm. Như vậy bạn đã vừa chuyển đổi công cụ RemoveAppxPackageTool sang định dạng .exe

3. Tạo file cài đặt


Nếu như bạn muốn chuyên nghiệp hơn nữa bạn có thể tạo thư mục RemoveAppxPackageTool đang lưu thư mục data và công cụ RemoveAppxPackageTool.exe sang file cài đặt bạn có thể sử dụng phần mềm Inno setup để tạo, tải phần mềm tại đây về cài đặt vào máy. Cách tạo như thế nào bạn có thể tham khảo các bài viết hướng dẫn trên mạng. Tôi chỉ dẫn chứng vài hình minh họa





Như vậy tôi đã vừa chia sẻ code và hướng dẫn cách tạo các bạn nào chưa biết có thể tham khảo bài viết này.

Phổ biến trong tuần

Tin Tức