Yes, Windows Defender is able to detect viruses and spyware, but only if they are recognised by its virus and spyware definitions. This means that it will not detect unknown or newly released viruses and spyware, as they have yet to be added to the list of definitions. Windows Defender uses a combination of real-time protection (preventing malicious files from running on the computer) and manual scanning to detect threats.
Real-time protection scans any files or programs as they are opened and downloaded, as well as any applications that are trying to run in the background. Windows Defender also monitors what websites you visit, to make sure that you don’t end up at malicious websites which could contain viruses or other forms of malware.
Manual scans with Windows Defender can be done either when prompted, or manually through the Windows Defender interface. Depending on your system settings, Windows Defender will automatically perform a quick scan every day, or a full scan every week. Manual scans can also be performed at any time by the user. For more detailed scanning, users can also choose an advanced scan, where specific files or folders can be scanned for viruses or spyware.
Windows Defender also provides several other security features, such as the ability to block changes to system settings and to quarantine or remove potentially dangerous files. In addition, Windows Defender is integrated with Microsoft Security Essentials, which allows users to perform cloud-based scans and the ability to download the latest virus definitions.
Overall, Windows Defender does offer basic antivirus and anti-spyware protection, however it is important to note that it is not a full-scale antivirus solution. It is best used in conjunction with other security software, such as a good firewall and anti-malware program, as well as keeping Windows up to date with the latest security patches.