We can’t delete files having system attribute set using del command from command line. For example in the folder c:\dir I have a file convert.exe. Now if I try to delete it from command line
c:\dir>del convert.exe Could Not Find c:\dir\convert.exe c:\dir>
But convert.exe is present in the directory c:\dir
If I do dir it shows empty folder.
c:\dir>dir Volume in drive C has no label. Volume Serial Number is C45C-FE6F Directory of c:\dir 27-02-2010 15:25. 27-02-2010 15:25 .. 0 File(s) 0 bytes 2 Dir(s) 27,060,707,328 bytes free
As a solution, to remove system files from command line, we can use /A switch with del command. In the above example we can run the below command to delete convert.exe
del /A:S convert.exe
This works on all versions of Windows OS, i.e Windows XP/2003, Windows Vista and Windows 7.
thank you very much
I know this file that I’m trying to delete from different drives in my computer is some sort of maleware or other virus. I tried your method but I get this command line back: “Access Denied” (without the quotes). Can you tell me where do I go from here? Appreciate your help.
Try taking ownership of the file. Also check this tool MoveFile http://technet.microsoft.com/en-us/sysinternals/bb897556
You can install unlocker on your system. You will get its option in context menu. All the files you elect to delete should be deleted at next boot time.
Thanks!