suppose u have a virus anyname.inf on desktop and want to delete then start ur cmd and change drive location on desktop using cd\ comand and then execute this given code below.....
attrib -s -h -r anyname.inf
Type the following commands in the Command Prompt
Type “:” in the command prompt and hit “Enter“. (“Drive_name” is where the problem occurs, it may be any USB drive)
Type “attrib” and hit “Enter“. (This shows the files that are present in the currently working directory. You can also use the command “dir/w/o/a/p“)
If there are any file named autorun.inf then go for next steps else the drive is not affected with any autorun.inf file.
Type “attrib -h -r -s -a *.* ” then hit “Enter“. (This command removes the Hidden, Read Only, System and Archive attributes over any file)
After unhiding and removing attributes you can see the files. So you can delete the file now.
Type “del ” in the Command Prompt and hit “Enter“. (As for example del autorun.inf)