I have a folder test which has some other files and folders. I also have a bat file delete.bat
test test\delete.bat
The bat file delete the contents of test using the next command: rmdir C:\test /s /q
I also want to delete the folder test. If i copy the delet.bat file and paste it in another directory the test folder will be deleted.
However, if i run the delete.bat file inside the test folder, all the contents of the test folder(included the delete.bat file) are deleted, but the test folder not.
I consider that this is because the test folder is opened.
Any suggestion? Is there any command that i can add at the beginning if delete.bat in order to close the folder first and then run the command rmdir C:\test /s /q?