Skip to content

Instantly share code, notes, and snippets.

@sidneyspe
Created May 12, 2023 18:06
Show Gist options
  • Save sidneyspe/88f6e8de3239d1d63cb5339eb171abf2 to your computer and use it in GitHub Desktop.
Save sidneyspe/88f6e8de3239d1d63cb5339eb171abf2 to your computer and use it in GitHub Desktop.
copy files modified today
@echo off
set "source_folder=C:\pasta\origem"
set "dest_folder=C:\pasta\destino"
set "file_pattern=bin\Debug\*.*"
xcopy "%source_folder%\%file_pattern%" "%dest_folder%\%file_pattern%" /S /D:%DATE% /F
pause
@sidneyspe
Copy link
Author

@echo off
set "source_folder=C:\pasta\origem"

rem Obter a data atual em um formato que o comando DIR possa entender
for /f "tokens=1-3 delims=/" %%a in ('date /t') do set "datestamp=%%c-%%b-%%a"

rem Exibir a lista de arquivos modificados hoje na pasta especificada
dir /s /a-d /b "%source_folder%" | findstr /i /c:"%datestamp%"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment