22setlocal EnableExtensions EnableDelayedExpansion
33
44REM ============================================================
5- REM extract-procreate-thumbnails-7zip .cmd
5+ REM extract-procreate-thumbnails.cmd
66REM
7- REM Extracts QuickLook\Thumbnail.png from each .procreate file and
8- REM saves it as a .png with the same base filename.
7+ REM Extract QuickLook\Thumbnail.png from each .procreate file and save it
8+ REM as a .png with the same base filename.
99REM
1010REM A .procreate file is a ZIP archive. The embedded preview is at:
1111REM QuickLook\Thumbnail.png
1212REM
13- REM REQUIREMENTS (choose one):
13+ REM REQUIREMENTS (Windows 10/11):
14+ REM - Install 7-Zip (recommended): https://www.7-zip.org/download.html
15+ REM (Install the "7-Zip for Windows" package.)
1416REM
15- REM Option A (portable, no install):
16- REM 1) Download 7zr.exe from 7-zip.org (console executable)
17- REM Put 7zr.exe in the SAME folder as:
18- REM - your .procreate files
19- REM - this .cmd script
20- REM
21- REM Option B (install 7-Zip):
22- REM 1) Install 7-Zip (Windows installer)
23- REM 2) This script will try common locations:
24- REM %ProgramFiles%\7-Zip\7z.exe
25- REM %ProgramFiles(x86)%\7-Zip\7z.exe
26- REM (or you can add 7-Zip to PATH)
17+ REM IMPORTANT:
18+ REM - This script uses the installed 7-Zip CLI: 7z.exe
19+ REM - The small "7zr.exe" (standalone) is NOT supported here because it
20+ REM cannot open ZIP archives reliably for this use-case (it is mainly
21+ REM for 7z archives), so .procreate extraction will fail.
2722REM
2823REM USAGE:
29- REM Place this script in the folder containing your .procreate files
30- REM then run :
31- REM extract-procreate-thumbnails-7zip .cmd
24+ REM 1) Copy this .cmd file into the folder that contains your .procreate files
25+ REM 2) Run it from Command Prompt (CMD) :
26+ REM extract-procreate-thumbnails.cmd
3227REM
3328REM OUTPUT:
3429REM file.procreate -> file.png
3530REM failures are logged to problems.log
31+ REM
32+ REM NOTES / LIMITATIONS:
33+ REM - CMD can be fragile with special characters in filenames (e.g. &, ^, !).
34+ REM If you have such filenames, prefer the PowerShell script.
3635REM ============================================================
3736
38- REM ---- Find 7-Zip console executable ----
37+ REM ---- Find installed 7z.exe ----
3938set " SEVENZIP = "
4039
41- REM Prefer portable exe in the same folder as this script:
42- if exist " %~dp0 7zr.exe" set " SEVENZIP = %~dp0 7zr.exe"
43- if not defined SEVENZIP if exist " %~dp0 7z.exe" set " SEVENZIP = %~dp0 7z.exe"
40+ REM Try PATH first
41+ for /f " delims=" %%P in ('where 7z.exe 2^ > nul ') do (
42+ set " SEVENZIP = %%P "
43+ goto :found7z
44+ )
4445
45- REM Common install paths:
46- if not defined SEVENZIP if exist " %ProgramFiles% \7-Zip\7z.exe" set " SEVENZIP = %ProgramFiles% \7-Zip\7z.exe"
46+ REM Try common install paths
47+ if exist " %ProgramFiles% \7-Zip\7z.exe" set " SEVENZIP = %ProgramFiles% \7-Zip\7z.exe"
4748if not defined SEVENZIP if exist " %ProgramFiles(x86)% \7-Zip\7z.exe" set " SEVENZIP = %ProgramFiles(x86)% \7-Zip\7z.exe"
4849
50+ :found7z
4951if not defined SEVENZIP (
50- echo ERROR: Could not find 7zr.exe or 7z.exe.
51- echo Put 7zr.exe next to this script, or install 7-Zip .
52+ echo ERROR: Could not find 7z.exe.
53+ echo Install 7-Zip from https://www.7-zip.org/ and try again .
5254 exit /b 1
5355)
5456
@@ -59,7 +61,7 @@ REM ---- Count .procreate files ----
5961set " total = 0"
6062for %%F in (*.procreate) do set /a total += 1
6163
62- if %total% == 0 (
64+ if %total% EQU 0 (
6365 echo No .procreate files found.
6466 exit /b 0
6567)
0 commit comments