I created a *.bat file to perform a delete once a month of tempory directories on the network.
My problem is I cant find a way to delete all the subdirectories of a directory without deleting that directory its self.
What I have is a directory on the server that has each of the users innitals in it that they can use for temp space. That directory on the server is shared and maped to a drive letter for users, so i cant delete that main directory on the server. What I want to do is delete all of the sub directories of it (the users initials) so I can copy in a fresh set of empty folders with the correct permisions.
The copy is not a problem. Doing a del /s /q only gets all files in all the directories but leaves those directories and any sub directories that were made. RD /s would do it if I picked the main directory but that is whats shared so I cant delete that without destroying the share and it needing to be remade.
Please help, any suggestions?
My problem is I cant find a way to delete all the subdirectories of a directory without deleting that directory its self.
What I have is a directory on the server that has each of the users innitals in it that they can use for temp space. That directory on the server is shared and maped to a drive letter for users, so i cant delete that main directory on the server. What I want to do is delete all of the sub directories of it (the users initials) so I can copy in a fresh set of empty folders with the correct permisions.
The copy is not a problem. Doing a del /s /q only gets all files in all the directories but leaves those directories and any sub directories that were made. RD /s would do it if I picked the main directory but that is whats shared so I cant delete that without destroying the share and it needing to be remade.
Please help, any suggestions?