Delete system file command line

by admin on February 27, 2010

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

c:\dir> 


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 known versions of Windows OS, i.e Windows XP/2003, Windows Vista and Windows 7.

{ 1 comment… read it below or add one }

Anonymous June 21, 2010 at 12:19 pm

thank you very much

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: