Delete system file command line

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


But convert.exe is present in the directory c:\dir

If I do dir it shows empty folder.

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 freeAs a solution, to remove system files from command line, we can use /A switch with delcommand. 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.