Created
May 12, 2023 18:06
-
-
Save sidneyspe/88f6e8de3239d1d63cb5339eb171abf2 to your computer and use it in GitHub Desktop.
copy files modified today
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
@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
@echo off
set "source_folder=C:\pasta\origem"
rem Obter a lista de pastas no diretório de origem
setlocal EnableDelayedExpansion
set "i=0"
for /d %%D in ("%source_folder%*") do (
set /a i+=1
set "folder[!i!]=%%~nxD"
)
rem Percorrer cada item na array e verificar se o caminho "/bin/Debug" existe
for /l %%i in (1,1,%i%) do (
set "fullpath=%source_folder%!folder[%%i]!\bin\Debug"
if exist "!fullpath!" (
echo !folder[%%i]!\bin\Debug
) else (
echo !folder[%%i]!
)
)
endlocal