1. Open a notepad (New Text Document.TXT) and copy the following code exactly onto it, and save the notepad.
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
2. Rename the file from New Text Document.TXT to myfile.com
3. Now run the anti virus scan on this myfile.com file.
If the anti virus is functioning properly on your computer, then it should generate a warning and immediately delete the file upon scanning. Otherwise you may have to re-install your antivirus.
NOTE: Most anti virus will pop-out a warning message in the Step-1 itself.
You can also place the myfile.com file in a ZIP or RAR file and run a scan on it so as to ensure whether your anti virus can detect the test string in the compressed archive. Any anti virus when scanning this file will respond exactly as it will do for a genuine virus/malicious code. This test will cause no damage to your computer even though the anti virus will flag it as a malicious script. Hence it is the safest method to test the proper functioning of any anti virus.