User User name Password  
   
Tuesday 15.10.2024 / 17:26
Search AfterDawn Forums:        In English   Suomeksi   På svenska
afterdawn.com > forums > digital video > video - software discussion > batch files for ripping and searching local media
Show topics
 
Forums
Forums
Batch files for ripping and searching local media
  Jump to:
 
Posted Message
bobobeastie
Newbie
_
6. January 2014 @ 18:44 _ Link to this message    Send private message to this user   
I have a large library of Blu-Rays that I own that I have ripped to image files. I have created a couple batch files to make things easier and I thought I would share them in case someone would find them useful.

The first batch file reads the disc size of a movie, then loops through a number of shared drives until it finds one with enough room, at which point it launches imgburn and has it start ripping the disc to a folder that is named the same as the iso file and disc label. There are ways to launch batch files from windows media center, I could probably find a link if needed.

The second batch file is used for generating a list of video files, then a second batch file is used to search through those results, the results of the search can be played by typing a corresponding number. If there is interest I will post that one as well. I made it because my main desktop runs windows 8 which seems to almost never successfully run searches, so this way you can quickly find a specific video and play it.

Here it is:
setlocal enableDelayedExpansion
echo OFF



set disk=D
set dest[1]=T
set dest[2]=W
set dest[3]=Z
set dest[4]=Y
set dest[5]=V
set dest[6]=X
set dest[7]=U

REM ECHO D is %disk%

echo Getting info about disc in drive:
for /f "tokens=1-3" %%n in ('"WMIC LOGICALDISK GET Name,Size,FreeSpace | find /i "%disk%:""') do set free=%%n& set total=%%p
echo.
echo %total% bytes total
echo ========================================
echo Size of disc in Drive D:
set total=%total:~0,-3%
set /a total=%total%/1049
echo.
echo %total% MB large (approx and underestimated)
set /a total=%total%/1024
echo.
echo %total% GB large (approx and underestimated)
set disc=%total%
REM PAUSE

set I=0

:loop
set /a I=%I%+1
echo I is %I%
echo getting !dest[%I%]! info
echo dest i is !dest[%I%]!
PAUSE
for /f "tokens=1-3" %%n in ('"WMIC LOGICALDISK GET Name,Size,FreeSpace | find /i "!dest[%I%]!:""') do set free=%%n
echo.

echo ========================================
echo %free% bytes free on Drive !dest[%I%]!
set free=%free:~0,-3%
set /a free=%free%/1049
echo.
echo %free% MB free (approx and underestimated)
set /a free=%free%/1024
echo.
echo %free% GB free (approx and underestimated)
set space=%free%
echo space is %space%
echo disc is %disc%
PAUSE
IF /i %space% GTR %disc% "C:\Program Files (x86)\ImgBurn\ImgBurn.exe" /MODE READ /OUTPUTMODE IMAGEFILE /SRC "D:" /DEST "!dest[%I%]!:\[DISC_LABEL]\[DISC_LABEL].ISO" /FILESYSTEM "UDF" /UDFREVISION "2.50" /volumelabel "[DISC_LABEL]" /START /EJECT /CLOSESUCCESS /start
IF /i %space% GTR %disc% goto :end
IF /i I==7 goto :fail
goto :loop

:fail

ECHO NO DRIVE SPACE? BUY MORE DRIVES!

:end

Most of the batch file came in different parts from googling around and finding parts that fit, such as getting the size of a disk and converting that to gigabytes. I had to mostly figure out the "magic" part on my own, which is where imgburn is told what to do. That part could be used on it's own if there is only one destination folder.

This message has been edited since posting. Last time this message was edited on 6. January 2014 @ 18:47

afterdawn.com > forums > digital video > video - software discussion > batch files for ripping and searching local media
 

Digital video: AfterDawn.com | AfterDawn Forums
Music: MP3Lizard.com
Gaming: Blasteroids.com | Blasteroids Forums | Compare game prices
Software: Software downloads
Blogs: User profile pages
RSS feeds: AfterDawn.com News | Software updates | AfterDawn Forums
International: AfterDawn in Finnish | AfterDawn in Swedish | AfterDawn in Norwegian | download.fi
Navigate: Search | Site map
About us: About AfterDawn Ltd | Advertise on our sites | Rules, Restrictions, Legal disclaimer & Privacy policy
Contact us: Send feedback | Contact our media sales team
 
  © 1999-2024 by AfterDawn Ltd.

  IDG TechNetwork