If you have some precious information on your computer, you'll want to back it up first. If the malicious software has infected any files on your software, some of your files will be deleted. So after the whole process is done, scan your files to make sure they're not infected. If they're not, you don't have to worry.
Use a Spyware Software to Scan Your PC
Do you currently have anti-spyware on your system? If you do, update it. If your system came with pre-installed software, the chances are that you can update it for a limited time, or you'll have to pay to update it.
What you'll want to do is scan your whole system using a full scan. Skip the quick scan for now. If you're worried about your system being infected, you might as well do a full scan to insure that you've go all of the bases covered.
Does Windows Have a Command To Remove Spyware?
Most newer versions of Microsoft Windows have a tool called Windows Defender. This is supposed to protect your system from malicious software. In most cases, Windows Defender did not defend my system. So I don't even bother using it. So to answer this questions, there is no windows command or tool worth using to remove spyware or adware.
Identifying the Spyware and Remove it
Most spyware softwares try to make it simple for the end user to remove threats from the system. After you do a scan, the software will display the threats. Select all software that has been identified as spyware and remove them. This step usually requires you to click on a button. Sometimes spyware is setup to auto-reinstall. So you'll want to re-scan for spyware after you reboot.
Do a Virus Scan
So once your computer is clean, I would go ahead and do a virus scan. I often see my friends and family stop the virus scan when it initializes. So by doing this, you'll be decreasing the chances of viruses being found.