Showing posts with label network file move. Show all posts
Showing posts with label network file move. Show all posts

Monday, July 19, 2021

Get most recent folder and move the files from one computer to another computer using batch commands

@echo off
FOR /F "delims=" %%i IN ('dir /b /ad-h /t:c /o-d') DO (
    SET a=%%i
    GOTO :found
)
echo No subfolder found
:found
echo Most recent subfolder: %a%

mkdir "\\DEE\AT\Files\%a%"
XCOPY %a% \\DEE\AT\Files\%a% /s /h /Y
pause