I see this question How to get folder path from file path with CMD
and try resolve my problem without success.
I need move files from origem to destination similar path using CMD
my source with subfolder "origem"
c:\temp\origem\subfolderA\file1.pdf
c:\temp\origem\subfolderA\file2.pdf
c:\temp\origem\subfolderA\file3.pdf
c:\temp\origem\subfolderB\file1.pdf
I need move files to diferent (similar) path with changing subfolder "origem" to "destination"
c:\temp\destination\subfolderA\file1.pdf
c:\temp\destination\subfolderA\file2.pdf
c:\temp\destination\subfolderA\file3.pdf
c:\temp\destination\subfolderB\file1.pdf
If use above code
FOR /R c:\temp\origem %F IN (*.pdf) DO move "%~dpfF" "%~dpF"
On "%~dpF" the parameter p I don't know change to destination