views:

394

answers:

2

Hi

I would like to know a way of deleting a read only file using a batch file or a command. Suppose i have a dll abc.dll and i am trying to delete this dll using the following command in a batch file del "C:\test\abcd.dll". It does not allow me to do that and it throws access denied message. However if i change the read only attribute to non read only i am able to successfully delete it. Anyway out.

Thanks

+7  A: 

Specify /F, it will force deletion of read-only files. Also see

del /?

However, that will not work when the file is in use.

Regards,

Sebastiaan

Sebastiaan Megens
I don't think this particular case is a "dll-in-use" one since changing the readonly (presumably with GUI) worked. +1.
paxdiablo
+3  A: 

del /f will delete readonly files.

Daren Schwenke
yea thanks i tried this and it worked
ckv