As I said, I've Some *.Xml Files in one folder, I want to move them to sub-dirs based on their names .
But, I need two more things :-
1- I've to apply/run the command from a parent directory, not from the *.xml directory
2- after making the needed sub-dirs, and moving the xml files into them , I want to move all of them into a new directory called "XML Backup"
For example:- my files located like this
X:\folder1\folder2\file1.xml X:\folder1\folder2\file2.xml X:\folder1\folder2\file3.xml
what I need to do is exactly like this:-
X:\folder1\folder2\xml_Backup\file1\file1.xml X:\folder1\folder2\xml_Backup\file2\file2.xml X:\folder1\folder2\xml_Backup\file1\file3.xml
please keep in mind, that I HAVE to run the command from
by the way, I've tried to use this command from a batch file in different ways, but I couldn't do it because of the conditions of what I need to do:-
for /R %%F in (*.xml) do ( 2>nul md "%%~nF" >nul Move /y "%%~nF.*" "%%~nF" )
If you tried to run this batch/command from the *.xml directory, it will make the Sub-Dirs correctly (based on the xml files names), and it'll move the xml files into them , but the problem is after making the new dirs, I need to move these xml dirs into another directory named "Xml Backup".