Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- :: Directories containing .dat files
- set "PARTS_DIR1=C:\Users\greg\Desktop\LDCAD\LDraw\parts"
- set "PARTS_DIR2=C:\Users\greg\Desktop\LDCAD\LDraw\unoff\parts"
- set "OUTPUT_DIR=C:\Users\greg\Desktop\LS\Win32"
- :: Loop through .dat files in the directories
- for %%A in ("%PARTS_DIR1%\*.dat" "%PARTS_DIR2%\*.dat") do (
- for %%B in ("%PARTS_DIR1%\*.dat" "%PARTS_DIR2%\*.dat") do (
- if not "%%A"=="%%B" (
- :: Extract filenames without extensions
- set "PART1=%%~nA"
- set "PART2=%%~nB"
- :: Generate folder and filenames with ; included
- set "FOLDER_NAME=!PART1! P1 #2 c1 = !PART2! P2 #4 s1;"
- set "TEXT_FILE_NAME=!FOLDER_NAME!.txt"
- :: Create the folder
- mkdir "%OUTPUT_DIR%\!FOLDER_NAME!" 2>nul
- :: Write the input file for LS2LDR.EXE
- echo [Main]>"%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
- echo Part1=!PART1!.dat>>"%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
- echo Part2=!PART2!.dat>>"%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
- :: Run LS2LDR.EXE
- start "" /b "C:\Users\greg\Desktop\LS\Win32\LS2LDR.EXE" "%OUTPUT_DIR%\!FOLDER_NAME!\!TEXT_FILE_NAME!"
- )
- )
- )
- echo All combinations processed.
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement