I'm writing a batch file to synch my music player with the music on my computer. I have an XCOPY command to update all the files that were added/changed on my computer, now I need something that will go through the contents of the music player and delete anything that doesn't exist on the computer. In an earlier thread, someone suggested a loop. Now that I think about it, I'll need two loops: one for deleting files, a second for deleting empty folders. Problem is, I've never written a loop in a batch file before. Is there a generous, properly-educated soul among you who could show me a "basic" example of a loop that can trace through a folder tree and its contents? Once I get that, I can handle the rest.