Guest User

uborder-tool.bat

a guest
Feb 12th, 2025
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.03 KB | Source Code | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4. :: Set the paths and other params
  5. set "INPUT_DIR=C:\path\to\input\png\files"
  6. set "OUTPUT_DIR=C:\path\to\output\txt\files"
  7. set "APP_PATH=python.exe"
  8. set "PY_SCRIPT=uborder-tool.py"
  9. set "OPTIONAL_PARAMS=-t 50"
  10. set "OUTPUT_FILE_EXT=slangp"
  11.  
  12. :: Check if directories exist
  13. if not exist "%INPUT_DIR%" (
  14.     echo Input directory does not exist: %INPUT_DIR%
  15.     pause
  16.     exit /b
  17. )
  18.  
  19. if not exist "%OUTPUT_DIR%" (
  20.     echo Output directory does not exist: %OUTPUT_DIR%
  21.     pause
  22.     exit /b
  23. )
  24.  
  25. :: Process each PNG file in the input directory
  26. for %%F in ("%INPUT_DIR%\*.png") do (
  27.    :: Get the base name of the file (without extension)
  28.     set "BASENAME=%%~nF"
  29.  
  30.     :: Define the output file path
  31.     set "OUTPUT_FILE=%OUTPUT_DIR%\!BASENAME!.!OUTPUT_FILE_EXT!"
  32.  
  33.     :: Run the app with the input PNG and output paths
  34.     echo Processing "%%F" to "!OUTPUT_FILE!"...
  35.     "%APP_PATH%" "!PY_SCRIPT!" "%%F" -o "!OUTPUT_FILE!" "!OPTIONAL_PARAMS!"
  36. )
  37.  
  38. echo All files processed.
  39. pause
  40.  
Advertisement
Add Comment
Please, Sign In to add comment