Skip to content

Commit

Permalink
Overwrite file protection
Browse files Browse the repository at this point in the history
Overwrite protection added as file counter
  • Loading branch information
mariosemes committed Aug 11, 2019
1 parent 3713cf1 commit 10f5ac0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions DrapTool/DrapToolMP4.bat
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,24 @@ if not exist %filepath%%outputfolder% (
)
goto :eof


:fileexistscheck
if not exist %filepath%%outputfolder%\%filewithoutextension%.%filetype% (
if not exist %filepath%%outputfolder%\%filewithoutextension%.mp4 (
set outputname="%filepath%%outputfolder%\%filename%"
goto :eof
) else (
set outputname="%filepath%%outputfolder%\%filewithoutextension%_%timestamp%.%filetype%"
set /A counter=1
call :filecounter
goto :eof
)
goto :eof

:filecounter
if not exist %filepath%%outputfolder%\%filewithoutextension%_(%counter%).mp4 (
set outputname="%filepath%%outputfolder%\%filewithoutextension%_(%counter%).mp4"
goto :eof
) else (
set /a counter+=1
goto :filecounter
)


rem -----------------------
Expand All @@ -125,5 +134,5 @@ rem -----------------------
rem Where the magic happens
rem -----------------------
:anyfileconvert
%scriptpath%\library\ffmpeg.exe -n -i "%filelocation%" %ENCODER% "%filepath%%outputfolder%\%filewithoutextension%.mp4"
%scriptpath%\library\ffmpeg.exe -n -i "%filelocation%" %ENCODER% %outputname%
goto :eof

0 comments on commit 10f5ac0

Please sign in to comment.