# Windows

# 一、磁盘管理

# 1.删除恢复分区(Recovery Partion)

命令行进入diskpart,选中需要删除的磁盘和分区,然后设置gpt attributes=0x8000000000000000,再执行delete partition即可删除。栗子:

list disk
sel disk 0
list partition
sel partition 1
gpt attributes=0x8000000000000000
delete partition
1
2
3
4
5
6

# 2.删除EFI分区

命令行进入diskpart,选中需要删除的分区,然后设置SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7,荔枝:

list disk
sel disk 0
list partition
sel partition 1
SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
1
2
3
4
5

# 二、关闭 Windows 11 中的 Windows Defender

# 2.1 Disable Microsoft Defender Using Group Policy Settings

The first way to disable Defender is by using the Group Policy security tool. To do just that, follow these steps:

  1. Click on Start, then Settings.

    img

  2. Choose Privacy & security, Windows Security, then Virus & threat protection.

    img

  3. Under Virus & threat protection settings, click on Manage settings.

    img

  4. Scroll down to the Tamper Protection option, and toggle the slider to Off.

    img

  5. Choose Yes to confirm the Do you want to allow this app to make changes to your device? prompt.

    img

  6. In the Tamper Protection section, a message will display stating that your device may be vulnerable. Use the x in the top right to close the window.

  7. gpedit.msc From the taskbar, press the search icon to enter a search for Edit group policy, then click the result to run the Group Policy editor.

    img

  8. In the app’s window on the left pane, find Computer Configuration and select the Administrative Templates, then Windows Components.

    img

  9. Scroll down to Microsoft Defender Antivirus.

    img

  10. Look for the setting Turn off Microsoft Defender Antivirus in the right pane.

    img

  11. Right-click on it and choose Edit.

    img

  12. In the popup window, check the Enabled box, then Apply, and OK.

    img

  13. Next, look for the setting Allow antimalware service to remain running always and right-click it. Then press Edit.

    img

  14. This time, check the Disabled option, click Apply, then OK.

    img

  15. Now look for the folder called Real-time Protection and double-click it to open.

    img

  16. Right-click the setting Turn off real-time protection, then choose Edit.

    img

  17. Check the Enabled box, click Apply, then OK.

    img

Now you have configured the group policy. You’ll need to set up a Task Scheduler to stop certain services from running and avoid errors once Defender has been disabled. To do this:

  1. Enter a search for the Task Scheduler app, then open it.

    img

  2. Expand the Task Scheduler Library folder in the left pane.

    img

  3. Expand Microsoft, Windows, then Windows Defender.

    img

  4. Right-click and Disable the following four tasks:

  • Windows Defender Cache Maintenance
  • Windows Defender Cleanup
  • Windows Defender Scheduled Scan
  • Windows Defender Verification

To update the computer and user policies:

  1. Open the Command Prompt as admin.

  2. Run the following command: **gpupdate/force**

    img

Windows Defender has been disabled and will not start up with Windows.

# 2.2 Disable Windows Defender by Modifying the Registry

Another way to deactivate Defender protection is by modifying the registry. Like the Group Policy option, this method requires the “Tamper Protection” setting to be disabled to stop the Defender settings from being tweaked. Follow these steps to do that:

  1. Click on Start, then Settings.

    img

  2. Click on Privacy & security, Windows Security, then Virus & threat protection.

    img

  3. Beneath Virus & threat protection settings, click on Manage settings.

    img

  4. Scroll down to the Tamper Protection option, and switch the slider to Off.

    img

  5. Choose Yes to allow the changes.

    img

  6. Use the x in the top right to close the window.

Now complete these pre-steps before editing the registry:

  1. Right-click on the Start menu.

    img

  2. Select Run and type regedit in the text field, then hit Enter.

    img

  3. In the Registry Editor, enter the following path in the address field: **HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender**

    img

To edit or add a value to this folder, you’ll need to change the owner first. By default, the owner is System. Follow these steps to change the folder owner:

  1. Right-click on the Windows Defender folder and choose Permissions.

    img

  2. Click on Advanced in the Permissions for Windows Defender window.

    img

  3. In the Owner field, click Change.

    img

  4. In the Advanced Security Settings for Windows Defender window, click Advanced.

    img

  5. Click Find Now, then select the admin account or the admin’s group.

    img

  6. Click OK, then OK again to confirm the changes.

    img

  7. Check the box next to Replace owner on subcontainers and objects.

    img

  8. Check the box next to Replace all child object permission entries with inheritable permission entries from this object.

    img

  9. Click Apply, then in the Windows Security warning popup, click Yes.

    img

  10. Click OK again to close the advanced security settings window.

    img

  11. Now, navigate to the Permissions for Windows Defender window under the Permissions for Everyone section.

    img

  12. And to grant users complete control by checking Allow beside the Full Control option.

    img

  13. Click Apply and OK to confirm the change.

    img

Finally, to edit the registry:

  1. Continuing from the Windows Defender branch in the Registry Editor, create three DWORD (32-bit) values. To do this, right-click any white space within the right pane, and select New, then the DWORD (32-bit) Value option.

img

Name the new values as follows:

  • DisableAntiVirus
  • DisableAntiSpyware
  • ServiceStartStates
  1. Right-click each value, select Modify, then change the Value data field to 1, then OK.

    img

  2. Now close the Registry Editor and restart your computer.

Once your computer restarts, the Windows Defender will be disabled.

# 2.3 Disable Windows Defender Using Autoruns

You can also permanently disable Windows Defender using the Autoruns for Windows utility tool. Here’s how:

  1. Download the latest version of Autoruns (opens new window) for Windows.

    img

  2. Open the downloaded file and right-click on the Autoruns folder to Extract All. Consider extracting the folder to your desktop for easy access.

img

Now you’ll need to disable permanent protection and boot in safe mode:

  1. Press the Windows icon from the taskbar, then choose Settings.

    img

  2. Choose Privacy & security, Windows Security, then Virus & threat protection.

    img

  3. Under the Virus & threat protection section, select Manage settings.

    img

  4. Press the Real-time Protection and Tamper Protection sliders to deactivate them.

    img

  5. Next, to put your computer in Safe Mode, enter a search to find the System Configuration app, then open it.

  6. In System Configuration, select the Boot tab.

    img

  7. Under Boot options, check the Safe boot box, and the Minimal option will set automatically.

    img

  8. Hit Apply, OK, then Restart.

    img

  9. Open the Autoruns folder on your desktop, click the Autoruns64.ex file, then Run to start it.

    img

  10. An Autoruns License Agreement window will display. If you agree with the terms, click Agree to continue.

    img

  11. In the Autoruns window, choose the Services tab.

    img

  12. By default, Windows services are hidden. To make them visible, click on Options from the main menu, then uncheck the Hide Windows Entries.

    img

  13. Go through the list of services for Windows Defender and uncheck the WinDefend box. This will disable the automatic startup for Windows Defender each time the computer reboots.

    img

  14. Now close Autoruns, then reboot your computer into normal mode.

To reboot your computer into normal mode:

  1. Press the Search icon on the taskbar and select System Configuration.

    img

  2. Check the Normal startup option.

    img

  3. Click Apply, OK, then Restart.

    img

Once your computer has rebooted, launch Task Manager and check if the Windows Defender service is running:

  1. Open Settings to see the Virus & threat protection status. To get there, go to Privacy & security, Windows Security, Virus & threat protection, then Home.

    img

  2. Verify that the Virus & threat protection status is set to Unknown.

Note: Avoid clicking on the Defender tile as it updates its information or displays the “Unknown” status. If you click on it during that time, Defender will be enabled again.

原文链接:How To Disable Windows Defender In Windows 11 (opens new window)

# 三、关闭休眠

运行命令powercfg.exe /hibernate off 可以关闭,如果要再次启用,运行powercfg.exe /hibernate on

更新时间: 4/25/2023, 10:34:19 AM