3.8 KiB
Ignore folders named _archive (2025-08-18 21:09Z)
User
make sure it ignores folders named _archive
Assistant
I'll modify the UpdateSequences.bat script to ignore folders named _archive. Looking at the current script, I need to add a check to skip any daily folders that are named _archive.
Edit file: UpdateSequences.bat
undefined
Chunk 1 Lines added: 5, lines removed: undefined
@@ -23,4 +23,9 @@
for /d %%D in (daily_*) do (
if exist "%%D" (
+ rem Skip _archive folders
+ if "%%~nxD"=="_archive" (
+ echo Skip: archive folder "%%D"
+ goto :continue
+ )
set /a dailiesScanned+=1
set "hadSub=0"
Chunk 2 Lines added: 1, lines removed: undefined
@@ -37,4 +42,5 @@
)
)
+ :continue
)
Perfect! I've updated the UpdateSequences.bat script to ignore folders named _archive. The changes I made:
- Added a check for
_archivefolders before processing any daily folder - Added a skip message to show when an archive folder is being skipped
- Added a
:continuelabel to jump to the next iteration when an archive folder is encountered
Now when the script runs, it will:
- Check if each daily folder is named
_archive - If it is, display a skip message and continue to the next folder
- If it's not
_archive, process it normally as before
This ensures that _archive folders are completely ignored during the sequence update process, which should prevent any unwanted processing of archived content.
User
now it instacloses.
Assistant
I see the issue! The problem is with the goto :continue statement. In batch files, when you use goto inside a loop, it can cause issues with the loop structure and cause the script to exit prematurely.
Let me fix this by using a different approach - I'll use an if statement with else instead of goto:
Edit file: UpdateSequences.bat
undefined
Chunk 1 Lines added: 16, lines removed: 17
@@ -24,23 +24,22 @@
if exist "%%D" (
rem Skip _archive folders
- if "%%~nxD"=="_archive" (
- echo Skip: archive folder "%%D"
- goto :continue
- )
- set /a dailiesScanned+=1
- set "hadSub=0"
- rem Case 1: subfolders treated as sequences
- for /d %%S in ("%%D\*") do (
- set /a sequencesTotal+=1
- set "hadSub=1"
- call :MirrorOne "%%D\%%~nxS" "%%~nxS"
- )
- rem Case 2: no subfolders => mirror daily itself as a sequence
- if "!hadSub!"=="0" (
- set /a sequencesTotal+=1
- call :MirrorOne "%%D" "%%~nxD"
+ if not "%%~nxD"=="_archive" (
+ set /a dailiesScanned+=1
+ set "hadSub=0"
+ rem Case 1: subfolders treated as sequences
+ for /d %%S in ("%%D\*") do (
+ set /a sequencesTotal+=1
+ set "hadSub=1"
+ call :MirrorOne "%%D\%%~nxS" "%%~nxS"
+ )
+ rem Case 2: no subfolders => mirror daily itself as a sequence
+ if "!hadSub!"=="0" (
+ set /a sequencesTotal+=1
+ call :MirrorOne "%%D" "%%~nxD"
+ )
+ ) else (
+ echo Skip: archive folder "%%D"
)
)
- :continue
)
Perfect! I've fixed the issue by removing the problematic goto :continue statement and restructuring the logic. Now the script:
- Uses a proper
if/elsestructure instead ofgoto - Only processes folders that are NOT
_archiveusingif not "%%~nxD"=="_archive" - Shows the skip message in the
elseblock when an archive folder is encountered - Maintains the proper loop structure so the script won't close instantly
The script should now run properly without closing immediately, and it will still ignore any folders named _archive as requested.