Computing.Net > Forums > Programming > How to use loops and variables

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to use loops and variables

Reply to Message Icon

Name: pball
Date: December 5, 2007 at 17:06:22 Pacific
OS: XP
CPU/Ram: 1 gig
Product: Home made
Comment:

I would like to be able to run all the video files in a folder through a command line program.

So this is what I would to happen automaticly

mkvextract tracks "%CD%\video_1.mkv" 4:"%CD%\video_1.ass"
mkvextract tracks "%CD%\video_2.mkv" 4:"%CD%\video_2.ass"

How do I create a loop that will put the name of the video in the input and output space?



Sponsored Link
Ads by Google

Response Number 1
Name: tonysathre
Date: December 5, 2007 at 18:55:32 Pacific
Reply:


@echo off
for /f "tokens=*" %%x in ('dir /b *.mkv') do (
mkvextract tracks "%%x" 4:"%%~nx.ass"
)

"Foolproof systems don't take into account the ingenuity of fools."


0

Response Number 2
Name: pball
Date: December 5, 2007 at 22:06:29 Pacific
Reply:

Thank you very much, it works perfectly.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


perl .pl files open as no... Batch Script for Reading/...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to use loops and variables

how to use Dos commands in Borlad C www.computing.net/answers/programming/how-to-use-dos-commands-in-borlad-c/4175.html

How to use Switch statement in vb www.computing.net/answers/programming/how-to-use-switch-statement-in-vb/6687.html

How to use string array in C++? www.computing.net/answers/programming/how-to-use-string-array-in-c/9478.html