Deleting a read only file using batch file or command
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 file named "abc.dll", and I am trying to delete this file using the following command in a batch file:
开发者_StackOverflow中文版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.
Specify /F
, it will force deletion of read-only files. Also see
del /?
However, that will not work when the file is in use.
del /f
will delete readonly files.
精彩评论