Advertisement
ItsPingu

Untitled

Dec 17th, 2024
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.32 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4. :: Directories containing .dat files
  5. set "PARTS_DIR1=C:\Users\greg\Desktop\LDCAD\LDraw\parts"
  6. set "PARTS_DIR2=C:\Users\greg\Desktop\LDCAD\LDraw\unoff\parts"
  7. set "OUTPUT_DIR=C:\Users\greg\Desktop\LS\Win32"
  8.  
  9. :: Loop through .dat files in the directories
  10. for %%A in ("%PARTS_DIR1%\*.dat" "%PARTS_DIR2%\*.dat") do (
  11.     for %%B in ("%PARTS_DIR1%\*.dat" "%PARTS_DIR2%\*.dat") do (
  12.         if not "%%A"=="%%B" (
  13.            :: Extract filenames without extensions
  14.             set "PART1=%%~nA"
  15.             set "PART2=%%~nB"
  16.  
  17.             :: Generate folder and filenames with ; included
  18.             set "FOLDER_NAME=!PART1! P1 #2 c1 = !PART2! P2 #4 s1;"
  19.             set "TEXT_FILE_NAME=!FOLDER_NAME!.txt"
  20.  
  21.             :: Create the folder
  22.             mkdir "%OUTPUT_DIR%\!FOLDER_NAME!" 2>nul
  23.  
  24.             :: Write the input file for LS2LDR.EXE
  25.             echo [Main]>"%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
  26.             echo Part1=!PART1!.dat>>"%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
  27.             echo Part2=!PART2!.dat>>"%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
  28.  
  29.             :: Run LS2LDR.EXE
  30.             start "" /b "C:\Users\greg\Desktop\LS\Win32\LS2LDR.EXE" "%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
  31.         )
  32.     )
  33. )
  34.  
  35. echo All combinations processed.
  36. pause
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement