News:

Current Full E-Touch Version: 10.2.0
Current Demo E-Touch Version: 10.0.0
Current Beta: 10.2.1 Beta 22 (09/02/23)

Main Menu

Some new .bat files

Started by leeclark2612, February 02, 2010, 10:29:42 AM

Previous topic - Next topic

leeclark2612

These Batch files are designed to compliment a Standalone Jukebox and make your Jukebox update itself each time it loads.

The script depends on the music files all being in one MUSIC folder,
e.g, C:\Music\Journey\Don't Stop Believeing.mp3.

The Batch files will run in sequence to check for new files in the MUSIC folder, using the first file 'file counter' the contents of your MUSIC folder are populated and saved as a list as new.txt and prev.txt. Each time the file checker is ran, the prev.txt is deleted and the new.txt is renamed to prev.txt. an updated version of new.txt is also created.

Next, the 'checker.bat' will compare the text files to check if there are any changes in the music folder. start another file called 'update.bat'.

If there aren't any new files, then the file checker will load e-touch. If there ARE new files then another file called 'update.bat' which launches config4 to update the databases.

Hopefully these will come in handy to a few people...so here is each file.

Start file counter.bat....copy everything below this line until exit..

@ECHO Counting Folders, Please Wait...
@ECHO OFF
@ECHO Deleting 'prev.txt'...
@ECHO Renaming 'new.txt' To 'prev.txt'...
@ECHO Creating New Version Of 'new.txt'...
@ECHO Checking For New Folders, Please Wait...
@ECHO This May Take Several Minutes Depending On The Amount Of Files...
@ECHO OFF
if not exist h:\jukebox\Music\new.txt dir/b/a-d > h:\jukebox\Music\\prev.txt
dir/b/a-d > h:\jukebox\Music\\new.txt
del "h:\Jukebox\Music\prev.txt"/Q /S >nul
ren h:\Jukebox\Music\new.txt prev.txt
setlocal enabledelayedexpansion
set folder=H:\Jukebox\Music
for /f "tokens=* delims=" %%v in ('dir /b "%folder%"') do (
   for /f "tokens=* delims=" %%i in ('dir /a:-d /b "%%v" 2^>^&1') do (
      if /i %%i NEQ "File Not Found" call set /a count=%%count+1
   )
   echo %%~nv: !count! >> new.txt
   set count=0
)
del "h:\Jukebox\Music\prev.txt"/Q /S >nul
ren h:\Jukebox\Music\new.txt prev.txt
setlocal enabledelayedexpansion
set folder=H:\Jukebox\Music
for /f "tokens=* delims=" %%v in ('dir /b "%folder%"') do (
   for /f "tokens=* delims=" %%i in ('dir /a:-d /b "%%v" 2^>^&1') do (
      if /i %%i NEQ "File Not Found" call set /a count=%%count+1
   )
   echo %%~nv: !count! >> new.txt
   set count=0
)
call "h:\jukebox\music\checker.bat"
EXIT

Start file checker.bat...copy everything below this line until exit.

@echo off & setLocal EnableDELAYedeXpansion

FC /b h:\jukebox\music\new.txt h:\jukebox\music\prev.txt

goto :!errorlevel!

:1
@echo Changes : Updating Database...
call "h:\jukebox\music\update.bat"
dir/b/a-d > changes.txt
goto :eof

:0
echo no changes
START /d "C:\Program Files\E-Touch Jukebox" etouch5.exe
exit

Star update.bat...copy everything below this line until exit.

del "C:\Program Files\E-Touch Jukebox\records.bak"/Q /S >nul
del "C:\Program Files\E-Touch Jukebox\records.cvr"/Q /S >nul
del "C:\Program Files\E-Touch Jukebox\records.rec"/Q /S >nul
del "C:\Program Files\E-Touch Jukebox\records.rex"/Q /S >nul
del "C:\Program Files\E-Touch Jukebox\Artist"/Q /S >nul
del "C:\Program Files\E-Touch Jukebox\Genres"/Q /S >nul
START /d "C:\Program Files\E-Touch Jukebox" Config4.exe /DRIVE H:\Jukebox\Music /GENRE /ARTIST /LAUNCH /NEW records
EXIT

I plan to use a file from within e-touch to copy new folders from a usb drive to the MUSIC folder on my jukebox, then when jukebox is restarted, it will automatically be up to date...

Tamsy

WOW!!!

Great work dude, will need to modify it and try it out on the weekend.

Cheers!
What's playing on my jukebox now...

fordman

Quote from: leeclark2612 on February 02, 2010, 10:29:42 AM

del "C:\Program Files\E-Touch Jukebox\Genres"/Q /S >nul


I would suggest you change the line above to:

del "C:\Program Files\E-Touch Jukebox\Genres\*.cvr"/Q /S >nul

If you use the genre pics in the filter. Otherwise, it deletes everything in the \genres folder. The *.cvr just specifies the .cvr files only! This is so you dont have to keep re-adding the filter .jpg's everytime you start up.

:beer
Fordman

leeclark2612

well spotted fordman...i'm on it...