Deleting a read only file using batch file or command
-
21-09-2019 - |
Question
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:
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.
Solution
Specify /F
, it will force deletion of read-only files. Also see
del /?
However, that will not work when the file is in use.
OTHER TIPS
del /f
will delete readonly files.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow