Files

39 lines
1.2 KiB
Batchfile
Raw Permalink Normal View History

2025-08-15 12:07:33 -06:00
@echo off
echo RebuildDailies - Copying 0MoveToCurrent.bat to all daily_* folders...
echo.
REM Check if source file exists
2025-08-15 12:14:56 -06:00
if not exist "A:\1 Amazon_Active_Projects\3 ProjectStructure\scripts_old\0MoveToCurrent.bat" (
echo ERROR: Source file "A:\1 Amazon_Active_Projects\3 ProjectStructure\scripts_old\0MoveToCurrent.bat" not found!
2025-08-15 12:07:33 -06:00
pause
exit /b 1
)
REM Search for daily_* folders recursively
echo Searching for daily_* folders in all subfolders...
echo.
REM Show which folders will be updated
echo Found the following daily_* folders:
for /f "delims=" %%D in ('dir /s /b /ad "*daily_*" 2^>nul') do echo - %%D
echo.
echo Copying 0MoveToCurrent.bat to each folder...
echo.
REM Copy the file to each daily_* folder found recursively
set /a count=0
for /f "delims=" %%D in ('dir /s /b /ad "*daily_*" 2^>nul') do (
echo Copying to %%D...
2025-08-15 12:14:56 -06:00
copy /Y "A:\1 Amazon_Active_Projects\3 ProjectStructure\scripts_old\0MoveToCurrent.bat" "%%D\" >nul
2025-08-15 12:07:33 -06:00
if errorlevel 1 (
echo ERROR: Failed to copy to %%D
) else (
echo SUCCESS: Copied to %%D
set /a count+=1
)
)
echo.
echo Operation completed. Successfully copied to %count% folders.
pause