Bring some order to your messy script folder

Put this script inside your video/script folder. Double click it and follow instructions.

  • It will look for matching .mp4 and .funscript files.
  • If it finds a video without a match it will put it into the folder you specified.
  • If it finds a .funscript with no match it will put that into a separate folder that you specified.
  • It’s non destructive.
  • you can run it a few times on the same folder if you want.
  • It will not overwrite anything, if there is a file with the same name in the destination folder it will simply just add a number on the end.
  • It does not delete or overwrite anything.
  • You can choose to make each folder before hand or define them when asked for input. Both will work.

Forum doesn’t allow me to upload a bat file directly so I will give you three options to attain the script. You only need to choose one.

`

  1. You can download bat script here
    OrderEleven.bat ~ pixeldrain

    `

  2. Here is the script as a txt. (after download change to .bat extension)
    OrderEleven.txt (1.1 KB)

    `

  3. And here is the code within the batch file:
    `

@echo off
setlocal enabledelayedexpansion

set /p videoFolder="1. Please enter the folder path to store the unmatched video files: "
if not exist "%videoFolder%\" mkdir "%videoFolder%"

set /p scriptFolder="2. Please enter the path to store the unmatched funscript files: "
if not exist "%scriptFolder%\" mkdir "%scriptFolder%"

echo Press Enter to execute Order 11...
pause >nul

for %%F in (*.mp4) do (
    if exist "%%~nF.funscript" (
        echo [OK] %%F
    )
    if not exist "%%~nF.funscript" (
        echo [MISSING] %%F
        set a=1
        :loop1
        if exist "%videoFolder%\%%~nF(!a!).mp4" (
            set /a a+=1
            goto :loop1
        )
        move "%%F" "%videoFolder%\%%~nF(!a!).mp4"
    )
)

for %%F in (*.funscript) do (
    if not exist "%%~nF.mp4" (
        echo [MISSING] %%F
        set b=1
        :loop2
        if exist "%scriptFolder%\%%~nF(!b!).funscript" (
            set /a b+=1
            goto :loop2
        )
        move "%%F" "%scriptFolder%\%%~nF(!b!).funscript"
    )
)
endlocal
pause
13 Likes

Thank you for this! It worked well except it moved all the multiaxis scripts even though they do have a video match while just keeping the orginal .funscript in the library location. If there is ever a version 2 of your script it would be really nice if it ignored these .pitch, .roll, and .twist files so that they stay in the original location. Besides that, this worked nicely.

2 Likes

Oh i dont have multi axis. So I was unaware of this. If you tell me how you would want to handle multi axis filenames I can really easily edit the script for this

Please everyone feel free to jump in if you have a better idea on how to handle the multi-axis scripts. The multi-axis scripts are named for example “videoname.pitch.funscript”. There is also “.roll , .twist , .sway , and .surge” i sometimes also see a .raw but i am unsure when that is used or if you need to account for that. Ideally i think the best way to handle these would be to handle them the same as your .funscript solution, aka if one of these scripts exist then just count it as correct and dont transfer anything. Some videos may only have 1 or 2 of these so the script shouldnt check for all of them in my opinion but just rather ignore them instead of moving them as it does now. If you can come up with a better solution please do, these are just my initial thoughts on it. Thank you.

do you want the non .funscript scripts moved into their own folder, so you have a folder for each “axis”? or just put all scripts that have no match into a single folder regardless of their extension?

personally i would be fine with all in the single folder

Alright, so I am very hesitant to release this version as I don’t have a multi axis device/scripts and therefore cannot properly test the code. From what little testing I did do though, it appears to be working as intended.

If something does go missing your best bet is to not download anything except for a third party data recovery program like “Recuva”. Use it to attempt to get the files back. This should work because deleted data isn’t actually gone until it is overwritten. The more you write to that disk the more likely you’ll get corrupted data back after trying to recover.

You have been warned

@echo off
setlocal enabledelayedexpansion

set /p videoFolder="1. Please enter the folder path to store the unmatched video files: "
if not exist "%videoFolder%\" mkdir "%videoFolder%"

set /p scriptFolder="2. Please enter the path to store the unmatched funscript files: "
if not exist "%scriptFolder%\" mkdir "%scriptFolder%"

echo Press Enter to execute Order 11...
pause >nul

for %%F in (*.mp4) do (
    set scriptFound=0
    if exist "%%~nF.funscript" (
        echo [OK] %%F
        set scriptFound=1
    ) else (
        for %%E in (.pitch .sway .roll .twist .surge) do (
            if exist "%%~nF%%E.funscript" (
                echo [OK] %%F
                set scriptFound=1
            )
        )
    )
    if !scriptFound! equ 0 (
        echo [MISSING] %%F
        set a=1
        :loop1
        if exist "%videoFolder%\%%~nF(!a!).mp4" (
            set /a a+=1
            goto :loop1
        )
        move "%%F" "%videoFolder%\%%~nF(!a!).mp4"
    )
)

for %%E in (.funscript .pitch.funscript .sway.funscript .roll.funscript .twist.funscript .surge.funscript) do (
    for %%F in (*"%%E") do (
        if not exist "%%~nF.mp4" (
            echo [MISSING] %%F
            set b=1
            :loop2
            if exist "%scriptFolder%\%%~nF(!b!)%%E" (
                set /a b+=1
                goto :loop2
            )
            move "%%F" "%scriptFolder%\%%~nF(!b!)%%E"
        )
    )
)
endlocal
pause
1 Like

Thank you for all the hard work, dont feel you have to keep working on it for my sake though. So i tested the new script and it still moved anything that wasn’t exactly a .funscript to the unmatched folder. Example: Dance.mp4, Dance.funscript, Dance.pitch.funscipt, Dance.roll.funscript. When i run Order11 the Dance.pitch.funscript as well as the Dance.roll.funscript got moved to the Unmatched Folder as well as got a (1) added to their name for example Dance.pitch(1).funscript.