Batch script - Move specific file ext


  1. Posts : 1
    Windows 10
       #1

    Batch script - Move specific file ext


    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 in case I need to move the files back to their original location. Thank you

    - - - Updated - - -

    NVM, a simple robocopy command will work;
    robocopy "C:\my source" "D:\My destination" *.onetoc2 /S /MOV
      My Computer


  2. Posts : 456
    Windows 10
       #2

    Looks like I came to late....

    Code:
    @echo off
    
    set Source=c:\Test
    set Destination=c:\Test2
    set Filetype=*.onetoc2
    
    robocopy "%Source%" "%Destination%" "%Filetype%" /mov /e
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:38.
Find Us




Windows 10 Forums