Maybe when you might need to check the proper functioning of an antivirus program.
Produce the virus in a test is very simple. Just open any text editor (notepad + + notepad) and copy following code:
X5O! P% @ AP [4 \ PZX54 (P ^) 7CC) 7) $ EICAR-STANDARD-ANTIVIRUS-TEST-FILE! $ H + H *
Then save the file to any name, only that the end of the *. exe. If your antivirus program is working properly, it should respond immediately after a file saving.
It is true that you created the virus is not dangerous, it only outputs the text "EICAR-STANDARD-ANTIVIRUS-TEST-FILE!"