SageTV Community  

Go Back   SageTV Community > General Discussion > General Discussion
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

General Discussion General discussion about SageTV and related companies, products, and technologies.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-07-2007, 01:16 AM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
DOS BAT Question (Find Movies)

Hi. I am trying to build a DOS batch script that will find all of my StarTrek movies and then call another bat file for processing.

I am having trouble with the last part. I get to the point where I have a listing of all of my Star Trek movies found on all of my drives, and I build a .txt file, but not sure how I can now read that data from DOS?

Anyone knows?


Here is what I have so far:
-----------------------------------------------

@ECHO off

for %%f IN ( "StarTrek" ) do call :drives %%f
goto eof


:drives

FOR %%d IN ( C: E: F: I: J: K: L: ) do call :do-drive %%d %%1

goto eof


:do-drive

echo Doing Drive %1

DIR /B "%1\TV Movies\%2*.mpg" > C:\temp\movies.txt

type C:\temp\movies.txt

for %%m in ( C:\temp\movies.txt ) do call :movie %%m

goto eof

:movie

echo %m

goto eof

:eof
Reply With Quote
  #2  
Old 07-07-2007, 05:23 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
Quote:
Originally Posted by joe123 View Post
Hi. I am trying to build a DOS batch script that will find all of my StarTrek movies and then call another bat file for processing.

I am having trouble with the last part. I get to the point where I have a listing of all of my Star Trek movies found on all of my drives, and I build a .txt file, but not sure how I can now read that data from DOS?

Anyone knows?


Here is what I have so far:
-----------------------------------------------

@ECHO off

for %%f IN ( "StarTrek" ) do call :drives %%f
goto eof


:drives

FOR %%d IN ( C: E: F: I: J: K: L: ) do call :do-drive %%d %%1

goto eof


:do-drive

echo Doing Drive %1

DIR /B "%1\TV Movies\%2*.mpg" > C:\temp\movies.txt

type C:\temp\movies.txt

for %%m in ( C:\temp\movies.txt ) do call :movie %%m

goto eof

:movie

echo %m

goto eof

:eof
You could do this a lot easier with Dirmon.


Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #3  
Old 07-07-2007, 01:21 PM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
Yes, I have used DirMon2 for other things.

How do I use DirMon2 *AND* specify strings of file names like to search for "StarTrek*" ?
Reply With Quote
  #4  
Old 07-07-2007, 01:39 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I don't use Dirmon so I can't help you with that. But if you want to develop your own script, I'd recommend learning VBScript or JScript rather than trying to do it with batch code, which is probably the least user-friendly way to do this kind of stuff. (Batch code is like 1960s-era programming technology.)
__________________
-- Greg
Reply With Quote
  #5  
Old 07-07-2007, 05:38 PM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
Quote:
Originally Posted by joe123 View Post
Yes, I have used DirMon2 for other things.

How do I use DirMon2 *AND* specify strings of file names like to search for "StarTrek*" ?
From Dirmon forum and Jere Jones:
Quote:
Command Line Options Substitutions
The command line options block is a rather complicated creature.

First, if it is blank, then the target file name is added.
Example
Command Line Options:
Result: ShowAnalyzer X:/Directory/file.mpg

Second, if it is not blank, but does not have any of the substitution strings then the the target file name is put before what ever is put in the options block.
Example
Command Line Options: -status
Result: ShowAnalyzer X:/Directory/file.mpg -status

Third, if there are any substitution strings used then ONLY what is built from the options block is passed to the processor.
Example
Command Line Options: -i [[%FULLFILESPEC%]] -o [[%PATH%/%BASENAME%.avi]]
Result: ShowAnalyzer -i X:/Directory/file.mpg -o X:/Directory/file.avi

What are the substitution strings and what will the result be?

Code:
Example filename: D:/TV/Nova.mpg
%FULLFILESPEC% - D:/TV/Nova.mpg
%DRIVE% - D
%PATH% - D:/TV
%DIRECTORY% - TV
%BASENAME% - Nova
%EXTENSION% - mpg
Example filename: D:/Nova.mpg
%FULLFILESPEC% - D:/Nova.mpg
%DRIVE% - D
%PATH% - D:
%DIRECTORY% -
%BASENAME% - Nova
%EXTENSION% - mpg
Example filename: //Media/TV/Nova.mpg
%FULLFILESPEC% - //Media/TV/Nova.mpg
%DRIVE% - //Media/TV
%PATH% - //Media/TV
%DIRECTORY% -
%BASENAME% - Nova
%EXTENSION% - mpg
Example filename: //Media/TV/SageTV/Nova.mpg
%FULLFILESPEC% - //Media/TV/SageTV/Nova.mpg
%DRIVE% - //Media/TV
%PATH% - //Media/TV/SageTV
%DIRECTORY% - SageTV
%BASENAME% - Nova
%EXTENSION% - mpg

Additionally, anything contained within [[ ]]'s will be surrounded with quotes if necessary (i.e. there are any spaces). DO NOT NEST THEM!! Bad, bad things will happen if they are nested. If someone can come up with a possible use for nested quotes, then I'll look into supporting it. Until then, just don't do it.
Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SageTV java issues jayemdae SageTV Linux 3 05-20-2007 02:55 PM
random failed to find gui server saxman SageTV Media Extender 5 04-18-2007 03:45 AM
Padding for Manual recording question dvd_maniac SageTV Customizations 10 12-16-2005 08:14 AM
MVP capability question SafetyBob Hardware Support 27 11-30-2005 10:58 PM
Browsing Video Library - too many movies! ShadoWolf SageTV Software 4 11-25-2005 06:07 PM


All times are GMT -6. The time now is 04:55 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.