I have the directory structure /foo/bar/fooBar/.. . I want to write a Windows command where I can mention the path till foo directory and it deletes all the files and directory recursively in /foo, but it should NOT delete the foo directory.
I have been using rmdir /q /s [path to foo]
but this command deletes the foo directory as well. Let me know if there is any command(s) to accomplish this.
You can use "find" command with "delete" option. This will remove files with specified name in current directory and sub directories.
To delete multiple files at once, simply list all of the file names after the “rm” command. File names should be separated by a space. With the command “rm” followed by multiple file names, you can delete multiple files at once.
rd /s /q /path/to/foo md /path/to/foo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With