Guest User

Untitled

a guest
Oct 23rd, 2025
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.66 KB | None | 0 0
  1. @echo off
  2. where PowerShell >nul 2>&1 || (
  3. echo PowerShell is not available. Please install or enable PowerShell.
  4. pause & exit 1
  5. )
  6. :: Ensure admin privileges
  7. fltmc >nul 2>&1 || (
  8. echo Administrator privileges are required.
  9. PowerShell Start -Verb RunAs '%0' 2> nul || (
  10. echo Right-click on the script and select "Run as administrator".
  11. pause & exit 1
  12. )
  13. exit 0
  14. )
  15. :: Initialize environment
  16. setlocal EnableExtensions DisableDelayedExpansion
  17.  
  18.  
  19. :: ----------------------------------------------------------
  20. :: -----------------Disable Copilot feature------------------
  21. :: ----------------------------------------------------------
  22. echo --- Disable Copilot feature
  23. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot!TurnOffWindowsCopilot"
  24. 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"
  25. :: Set the registry value: "HKCU\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot!TurnOffWindowsCopilot"
  26. 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"
  27. :: ----------------------------------------------------------
  28.  
  29.  
  30. :: ----------------------------------------------------------
  31. :: ------------------Disable Copilot access------------------
  32. :: ----------------------------------------------------------
  33. echo --- Disable Copilot access
  34. :: Set the registry value: "HKCU\Software\Microsoft\Windows\Shell\Copilot\BingChat!IsUserEligible"
  35. 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"
  36. :: Suggest restarting computer for changes to take effect
  37. 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"^""; }"
  38. :: ----------------------------------------------------------
  39.  
  40.  
  41. :: ----------------------------------------------------------
  42. :: -----------Disable Copilot auto-launch on start-----------
  43. :: ----------------------------------------------------------
  44. echo --- Disable Copilot auto-launch on start
  45. :: Set the registry value: "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings!AutoOpenCopilotLargeScreens"
  46. 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"
  47. :: ----------------------------------------------------------
  48.  
  49.  
  50. :: ----------------------------------------------------------
  51. :: ------------Remove "Copilot" icon from taskbar------------
  52. :: ----------------------------------------------------------
  53. echo --- Remove "Copilot" icon from taskbar
  54. :: Set the registry value: "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced!ShowCopilotButton"
  55. 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"
  56. :: Suggest restarting explorer.exe for changes to take effect
  57. 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"^""; }"
  58. :: ----------------------------------------------------------
  59.  
  60.  
  61. :: ----------------------------------------------------------
  62. :: ----------Disable Edge Copilot and Hubs Sidebar-----------
  63. :: ----------------------------------------------------------
  64. echo --- Disable Edge Copilot and Hubs Sidebar
  65. :: Configure "HubsSidebarEnabled" Edge policy
  66. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!HubsSidebarEnabled"
  67. 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"
  68. :: Configure "StandaloneHubsSidebarEnabled" Edge policy
  69. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!StandaloneHubsSidebarEnabled"
  70. 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"
  71. :: Suggest restarting Edge for changes to take effect
  72. 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"^""; }"
  73. :: ----------------------------------------------------------
  74.  
  75.  
  76. :: ----------------------------------------------------------
  77. :: ------Disable Edge Copilot browsing data collection-------
  78. :: ----------------------------------------------------------
  79. echo --- Disable Edge Copilot browsing data collection
  80. :: Configure "DiscoverPageContextEnabled" Edge policy
  81. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!DiscoverPageContextEnabled"
  82. 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"
  83. :: Configure "CopilotPageContext" Edge policy
  84. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!CopilotPageContext"
  85. 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"
  86. :: Configure "CopilotCDPPageContext" Edge policy
  87. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!CopilotCDPPageContext"
  88. 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"
  89. :: ----------------------------------------------------------
  90.  
  91.  
  92. :: ----------------------------------------------------------
  93. :: -------Disable Edge Copilot access on new tab page--------
  94. :: ----------------------------------------------------------
  95. echo --- Disable Edge Copilot access on new tab page
  96. :: Configure "NewTabPageBingChatEnabled" Edge policy
  97. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!NewTabPageBingChatEnabled"
  98. 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"
  99. :: ----------------------------------------------------------
  100.  
  101.  
  102. :: ----------------------------------------------------------
  103. :: ----------Disable outdated Edge Discover button-----------
  104. :: ----------------------------------------------------------
  105. echo --- Disable outdated Edge Discover button
  106. :: Configure "EdgeDiscoverEnabled" Edge policy
  107. :: Set the registry value: "HKLM\SOFTWARE\Policies\Microsoft\Edge!EdgeDiscoverEnabled"
  108. 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"
  109. :: ----------------------------------------------------------
  110.  
  111.  
  112. :: Pause the script to view the final state
  113. pause
  114. :: Restore previous environment settings
  115. endlocal
  116. :: Exit the script successfully
  117. exit /b 0
Advertisement
Add Comment
Please, Sign In to add comment