I'm new to Windows scripting. I wrote a small batch file to move subdirectories and files around in a large directory.
@ECHO OFF
for /f %x in ('dir /ad /b') do move %xipad %x\
for /f %x in ('dir /ad /b') do md %x\thumbs
for /f %x in ('dir /ad /b') do move %x\*thumb.png %x\thumbs\
for /f %x in ('dir /ad /b') do move %x\*thumb.jpg %x\thumbs\
for /f %x in ('dir /ad /b') do del %x\%xipad\*thumb.png
for /f %x in ('dir /ad /b') do del %x\%xipad\*thumb.jpg
for /f %x in ('dir /ad /b') do del %x\xml.php
for /f %x in ('dir /ad /b') do del %x\%xipad\xml.php
It looks like I can put all of my commands into a single "for /f %x in..." loop and then do the logic inside. I should probably check if the extension is .png or .jpg (not with two separate commands). What's the best way to do these two actions? In addition is there something else I should implement to make this better?