Need help on how to start with this batch program

Status
Not open for further replies.

sceneguy

Banned
Banned
652
2011
137
0
hello,

here is the background.(you may skip this :YAWN:)

I have created a command line sequence for taking out the audio and video stream(s) from a mpeg-ts file and muxing into mkv for portability reasons.here are the steps that are involved. For this i already have a file called test.ts
in a folder called d:\recording\test.ts

Code:
I check for the file name(in this case test.ts)
Code:
1. First step i do is move the file from d:\recording\test.ts to d:\eac3to\test.ts using Command Prompt
Code:
2. I use eac3to to demux video to video.mkv and audio to audio.aac
Code:
3.move audio.aac and video.mkv to d:\mkvtoolnix\ and mux to output.mkv to the folder d:\outputfolder\output.mkv
using mkvmerge
Code:
4.i check if the output.mkv is ok and then delete test.ts(source file).I also delete audio.aac and video.mkv
Now i wanna automate this process.I want the system to ask me the name of the file located in d:\recording and also the output file name.Then it should do all the above process and after its done,ask me if the file is good,if i say yes,it should delete all the temp files..

i`m not asking for a complete .bat file here.i want a set of commands that may come in handy.

regards
sceneguy


NS:all the above steps are done to work 100% manually.looking for a way to automate the process.

thanks
 
7 comments
if you are know programming in C# or any .NET Windows Form Language, it have process invoking techniques by which you can run the CMD commands steps by steps.

if you need help i can it for you ;)
 
i dont know much of c# or .net and dont want to learn them from scratch.i know c and java very well,by very well i mean coding applications.

any help is apprciated.which do you recommend,c# OR .net
 
You are not saying whether the batch is for a linux or windows process??

But I will presume windows command line .. This would be a simple structure but you would have to know what the return codes are from each program you run upon completion or failure.
PHP:
IF ERRORLEVEL 255 GOTO Label255
IF ERRORLEVEL 254 GOTO Label254
   •
   •
   •
IF ERRORLEVEL   2 GOTO Label2
IF ERRORLEVEL   1 GOTO Label1
GOTO Label0

:Label255
(commands to be executed at errorlevel 255)
GOTO End

   •
   •
   •

:Label1
(commands to be executed at errorlevel 1)
GOTO End

:Label0
(commands to be executed at errorlevel 0, or no errorlevel)

:End
 
@Lock Down : Sorry for not mentioning platform.Its windows. The commands always will be success.(99%).How to make it execute the next command after the previous one process has closed?

Thanks for your time.
 
You can move files using the move command like this:
Code:
move /-y "d:\recording\test.ts" "d:\eac3to\"
Check if the output is there/okay using this:
Code:
if exist "d:\mkvtoolnix\output.mkv" (
echo Everyting is OK!
) else (
echo Error, failed!
)
 
hey one more thing,is it possible to use a for loop to see if the extension is a .ts . then do the same process till all files have been exausted/deleted?
 
Status
Not open for further replies.
Back
Top