the problem is after making the new dirs, I need to move these xml dirs into another directory named "Xml Backup"
Modifique seu lote para criar a pasta "xml_Backup" (se ela não existir) e inclua isso nos seus caminhos de destino para os comandos MD
e Move
no loop.
Algo como:
rem Change to folder specified as argument.
pushd %1
rem Check if 'backup' folder exists; if not, create it.
if not exist "xml_Backup" md "xml_Backup"
rem Loop through files in the current folder.
for /R %%F in (*.xml) do (
rem Create subfolder in 'backup' folder matching this file's name.
md "xml_Backup\%%~nF"
rem Move file to that folder.
move /y "%%~nF.*" "xml_Backup\%%~nF"
)
rem Change back to the original directory we were in when pushd was executed.
popd
Execute com batchname.bat "c:\folderContainingXMLs"
.
IE: batchname.bat "X:\folder1\folder2"
ou batchname.bat ".\folder2"
, etc.