Hi @shines7 ,
I suggest you to read the document of WDEnable and WDStatus which are able to enable/disable Windows Defender and view the status of Windows Defender.
Note:
WDEnable is no longer available for use as of Windows 10, version 1607.
Beginning in Windows 10, version 1607 and Windows Server 2016, the WDEnable function always returns E_NOTIMPL.
Best regards,
Elya
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.