@echo off cd /d "%~dp0" REM C:\Users\def\Nextcloud\3dp_bin\Prusa3D\PrusaSlicer\ set LOCKED=0 if exist !!STARTUP_lock.dat ( findstr /r /c:^%COMPUTERNAME%..$ "!!STARTUP_lock.dat" > NUL || ( echo "We are locked by computer:" type !!STARTUP_lock.dat echo "" echo "Close this window to abort running" echo "... or hit a key to run anyway ..." echo "" pause ) set LOCKED=1 ) echo %COMPUTERNAME% > !!STARTUP_lock.dat set QUOTE=" ( ( assoc .3mf ) 2>NUL | find "PrusaSlicerPortable.Document" ) >NUL || ( powershell -Command "Start-Process -FilePath cmd -Args '/c %QUOTE%%~dp0fileassocs.bat%QUOTE% %0' -Verb runAs -Wait" echo File associations repaired pause ) SetUserFTA\SetUserFTA.exe .3mf PrusaSlicerPortable.Document SetUserFTA\SetUserFTA.exe .stl PrusaSlicerPortable.Document echo "Start-Process -FilePath .\Prusa-slicer.exe -Args \"--datadir profile %*\" -Wait; del !!STARTUP_lock.dat" if %LOCKED% == 0 ( start /b PowerShell.exe -command "Start-Process -FilePath .\Prusa-slicer.exe -Args \"--datadir profile %*\" -Wait; del !!STARTUP_lock.dat" ) else ( start /b PowerShell.exe -command "Start-Process -FilePath .\Prusa-slicer.exe -Args \"--datadir profile %*\" -Wait" ) ::END