I run win11 pro on a minis forum um690.
I am using Cobian Reflector to incrementally backup my documents which makes a lot of empty folders. I can easily delete these empty directories in File Explorer using context menu. I wanted to automate this in a batch file but found that these empty folders made by my backup program are not easy to delete by command line. I have tried RD "My \folder\path" and get access denied. I have tried changing the ownership from myself, Admin, to Everyone and also change their respective permissions to full control but still get Access denied. Oddly, RD "My \folder\path" /s will delete the folder(adding the /q flag makes it quite). The "/s" deletes subfolders and files so that implies that the folder was not empty but show hidden files is checked and properties shows 0 files, 0 bytes and 0 folders in file explorer.
Although this works, it deletes empty subfolders which I don't want to happen because it is a backup. I just want empty folders in current directory deleted and empty folders that are down deeper in other directories left alone.
I am using Cobian Reflector to incrementally backup my documents which makes a lot of empty folders. I can easily delete these empty directories in File Explorer using context menu. I wanted to automate this in a batch file but found that these empty folders made by my backup program are not easy to delete by command line. I have tried RD "My \folder\path" and get access denied. I have tried changing the ownership from myself, Admin, to Everyone and also change their respective permissions to full control but still get Access denied. Oddly, RD "My \folder\path" /s will delete the folder(adding the /q flag makes it quite). The "/s" deletes subfolders and files so that implies that the folder was not empty but show hidden files is checked and properties shows 0 files, 0 bytes and 0 folders in file explorer.
Although this works, it deletes empty subfolders which I don't want to happen because it is a backup. I just want empty folders in current directory deleted and empty folders that are down deeper in other directories left alone.
My Computer
System One
-
- OS
- win11 pro
- Computer type
- PC/Desktop
- Manufacturer/Model
- minis forum/um690
- CPU
- amd
- Screen Resolution
- 4k