These questions are answered in the help file. see /help /remove, and /help /rmdir.
As for /rmdir, it cannot delete a folder with files in it. one solution for that, is to use a powerful yet dangrous DOS command called DELTREE:
//run -n command /c deltree /y [color:blue]folder[/color]
Note: folder name does
not end up with a slash. otherwise, only files and sub directories will be removed, but the folder won't.
Another solution would be using $findfile to remove the existing files, then $finddir to remove sub directories, then /rmdir to remove the folder:
//!.echo -q $findfile([color:blue]folder[/color],*,0,remove $+(",$1-,"))
//var %i = $finddir([color:blue]folder[/color],*,0) | while %i { rmdir $finddir([color:blue]folder[/color],*,%i) | dec %i }
//rmdir [color:blue]folder[/color]
The reason why $finddir isn't used in the same way of $findfile, is because it's necessary to remove the most-depth sub directories before removing their parent folders. that's why a reverse loop is used.
Personally, I'd avoid using the DELTREE command when unnecessary, so I suggest you to try the scripted example first. worked here