Good Day, I'm running Windows 10 and searched a few threads but didn't fine one specific to my needs so hoping someone could help me out. What I would like is a batch script to search a folder and all it's subfolders for a specific file ext of my choosing, for example *.onetoc2 and move it to a Temp directory of my choosing creating the same folder name structure within it of where the original came from just incase I need to move the files back to their original location. Thank you
It would be easier to write such PowerShell script (since PowerShell has full scale programming language). Also in case files in different subfolders will not have the same names there is another possibility - to copy found files to temp folder and create a batch file to copy those files back to original place. That will be easier to implement in batch script.
Okay, thanks, looks like a simple robocopy command will do what I want; robocopy "C:\My Source" "C:\My Destination" *.onetoc2 /S /MOV
Or xcopy https://ss64.com/nt/xcopy.html https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy