有问题加QQ咨询小姐姐

QQ:3646975618

在线客服
如何关闭win10及以上防火墙 0 回复672 查看
2023年12月27日 20:38

以下所有命令,都使用administrator权限在powershell下执行!

按照自己需要复制粘贴,一条命令复制粘贴一次

 

**************************************

 

# 获取操作权限,选择y即可(所有命令执行之前先执行这个,否则很多命令无法执行)

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

 

##########关闭defener

 

# 禁用 Windows Defender 实时监控

Set-MpPreference -DisableRealtimeMonitoring $true

 

# 禁用行为监视

Set-MpPreference -DisableBehaviorMonitoring $true

 

# 禁用云提供的保护

Set-MpPreference -DisableIOAVProtection $true

 

# 禁用样本提交

Set-MpPreference -DisablePrivacyMode $true

 

# 通过修改注册表来彻底关闭Windows Defender

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 1

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" -Name DisableRealtimeMonitoring -Value 1

 

# 以管理员权限运行此脚本

 

# 从组策略中禁用 Windows Defender

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Value 1

 

# 禁用 Windows Defender 的服务

Set-Service -Name WinDefend -StartupType Disabled

Stop-Service -Name WinDefend -Force

 

# 禁用 Windows Defender 的实时监控

Set-MpPreference -DisableRealtimeMonitoring $true

 

# 禁用 Windows Defender 的云提供的保护

Set-MpPreference -DisableIOAVProtection $true

 

# 禁用 Windows Defender 的自动样本提交

Set-MpPreference -DisablePrivacyMode $true

 

# 禁用 Windows Defender 的行为监控

Set-MpPreference -DisableBehaviorMonitoring $true

 

###############关闭update

 

# 设置组策略以禁用 Windows 自动更新

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name NoAutoUpdate -Value 1

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name AUOptions -Value 1

 

# 停止并禁用 Windows Update 服务

Stop-Service -Name wuauserv

Set-Service -Name wuauserv -StartupType Disabled


 

# 禁用 Windows Update 服务

Stop-Service -Name wuauserv -Force

 

# 禁用更新 Orchestrator 服务,防止计划的更新任务

Set-Service -Name UsoSvc -StartupType Disabled

Stop-Service -Name UsoSvc -Force

 

##################关闭系统保护

# 以管理员权限运行这个脚本

# 获取所有磁盘驱动器

$drives = Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3}

 

foreach ($drive in $drives)

{

    # 对每一个驱动器关闭系统保护

    Disable-ComputerRestore -Drive $drive.DeviceID

}

 

####################电源选项

 

# 设置电源计划为高性能

powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

 

# 设置关闭显示器的时间为从不

powercfg -change -monitor-timeout-ac 0

 

# 设置计算机进入睡眠状态的时间为从不

powercfg -change -standby-timeout-ac 0


 

####################关闭任务栏预览

 

# 设置注册表以禁用任务栏预览

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ExtendedUIHoverTime" -Value 30000

 

# 指定注册表路径

$registryPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband"

 

# 创建一个名为 NumThumbnails 的 32 位 DWORD 值,数值数据设置为 0

Set-ItemProperty -Path $registryPath -Name "NumThumbnails" -Value 0 -Type DWORD

 

# 重新启动资源管理器以应用更改

Stop-Process -Name explorer -Force

Start-Process explorer

 

########################win11关闭push_notification

 

# 以管理员权限运行此脚本

 

# 修改注册表键的值

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WpnUserService" -Name "Start" -Value 0

 

######################任务栏按钮调整

 

# 锁定任务栏

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSizeMove" -Value 0

 

# 使用小任务栏按钮

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Value 1

 

# 将任务栏位置设置为屏幕底部

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" -Name "Settings" -Value ([byte[]](3,0,0,0,254,255,255,255,2,0,0,0,3,0,0,0,56,0,0,0,255,255,255,255,255,255,255,255,252,4,0,0,38,2))

 

# 将任务栏按钮设置为从不合并

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Value 2

 

# 重新启动资源管理器以应用更改

Stop-Process -Name explorer -Force

Start-Process explorer

 

#################关闭防火墙

 

# 关闭 Windows 防火墙的所有配置文件

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

 

# 关闭 Windows Defender 防火墙的实时监控

Set-MpPreference -DisableRealtimeMonitoring $true

 

# 关闭 Windows Defender 的云提供的保护

Set-MpPreference -DisableIOAVProtection $true

 

全部回复