Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- where PowerShell >nul 2>&1 || (
- echo PowerShell is not available. Please install or enable PowerShell.
- pause & exit 1
- )
- :: Ensure admin privileges
- fltmc >nul 2>&1 || (
- echo Administrator privileges are required.
- PowerShell Start -Verb RunAs '%0' 2> nul || (
- echo Right-click on the script and select "Run as administrator".
- pause & exit 1
- )
- exit 0
- )
- :: Initialize environment
- setlocal EnableExtensions DisableDelayedExpansion
- :: ----------------------------------------------------------
- :: -----------------Disable Copilot feature------------------
- :: ----------------------------------------------------------
- echo --- Disable Copilot feature
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot!TurnOffWindowsCopilot"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot'; $data = '1'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' /v 'TurnOffWindowsCopilot' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Set the registry value: "HKCU\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot!TurnOffWindowsCopilot"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKCU\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot'; $data = '1'; reg add 'HKCU\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' /v 'TurnOffWindowsCopilot' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: ------------------Disable Copilot access------------------
- :: ----------------------------------------------------------
- echo --- Disable Copilot access
- :: Set the registry value: "HKCU\Software\Microsoft\Windows\Shell\Copilot\BingChat!IsUserEligible"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKCU\Software\Microsoft\Windows\Shell\Copilot\BingChat'; $data = '0'; reg add 'HKCU\Software\Microsoft\Windows\Shell\Copilot\BingChat' /v 'IsUserEligible' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Suggest restarting computer for changes to take effect
- PowerShell -ExecutionPolicy Unrestricted -Command "$message = 'For the changes to fully take effect, please restart your computer.'; $warn = $false; if ($warn) { Write-Warning "^""$message"^""; } else { Write-Host "^""Note: "^"" -ForegroundColor Blue -NoNewLine; Write-Output "^""$message"^""; }"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: -----------Disable Copilot auto-launch on start-----------
- :: ----------------------------------------------------------
- echo --- Disable Copilot auto-launch on start
- :: Set the registry value: "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings!AutoOpenCopilotLargeScreens"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings'; $data = '0'; reg add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings' /v 'AutoOpenCopilotLargeScreens' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: ------------Remove "Copilot" icon from taskbar------------
- :: ----------------------------------------------------------
- echo --- Remove "Copilot" icon from taskbar
- :: Set the registry value: "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced!ShowCopilotButton"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'; $data = '0'; reg add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' /v 'ShowCopilotButton' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Suggest restarting explorer.exe for changes to take effect
- PowerShell -ExecutionPolicy Unrestricted -Command "$message = 'This script will not take effect until you restart explorer.exe. You can restart explorer.exe by restarting your computer or by running following on command prompt: `taskkill /f /im explorer.exe & start explorer`.'; $warn = $false; if ($warn) { Write-Warning "^""$message"^""; } else { Write-Host "^""Note: "^"" -ForegroundColor Blue -NoNewLine; Write-Output "^""$message"^""; }"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: ----------Disable Edge Copilot and Hubs Sidebar-----------
- :: ----------------------------------------------------------
- echo --- Disable Edge Copilot and Hubs Sidebar
- :: Configure "HubsSidebarEnabled" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!HubsSidebarEnabled"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'HubsSidebarEnabled' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Configure "StandaloneHubsSidebarEnabled" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!StandaloneHubsSidebarEnabled"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'StandaloneHubsSidebarEnabled' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Suggest restarting Edge for changes to take effect
- PowerShell -ExecutionPolicy Unrestricted -Command "$message = 'For the changes to fully take effect, please restart Microsoft Edge.'; $warn = $false; if ($warn) { Write-Warning "^""$message"^""; } else { Write-Host "^""Note: "^"" -ForegroundColor Blue -NoNewLine; Write-Output "^""$message"^""; }"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: ------Disable Edge Copilot browsing data collection-------
- :: ----------------------------------------------------------
- echo --- Disable Edge Copilot browsing data collection
- :: Configure "DiscoverPageContextEnabled" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!DiscoverPageContextEnabled"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'DiscoverPageContextEnabled' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Configure "CopilotPageContext" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!CopilotPageContext"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'CopilotPageContext' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: Configure "CopilotCDPPageContext" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!CopilotCDPPageContext"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'CopilotCDPPageContext' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: -------Disable Edge Copilot access on new tab page--------
- :: ----------------------------------------------------------
- echo --- Disable Edge Copilot access on new tab page
- :: Configure "NewTabPageBingChatEnabled" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!NewTabPageBingChatEnabled"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'NewTabPageBingChatEnabled' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: ----------------------------------------------------------
- :: ----------------------------------------------------------
- :: ----------Disable outdated Edge Discover button-----------
- :: ----------------------------------------------------------
- echo --- Disable outdated Edge Discover button
- :: Configure "EdgeDiscoverEnabled" Edge policy
- :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!EdgeDiscoverEnabled"
- PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Policies\Microsoft\Edge'; $data = '0'; reg add 'HKLM\SOFTWARE\Policies\Microsoft\Edge' /v 'EdgeDiscoverEnabled' /t 'REG_DWORD' /d "^""$data"^"" /f"
- :: ----------------------------------------------------------
- :: Pause the script to view the final state
- pause
- :: Restore previous environment settings
- endlocal
- :: Exit the script successfully
- exit /b 0
Advertisement
Add Comment
Please, Sign In to add comment