0

Edit 3,.

based on aacini's comment, i wrote the following

@echo off

for %%a in ("*.mp4") do echo.>"J:\=Backup Files\testing\%%a.avs"

for %%a in ("*.mp4") do @echo DirectShowSource("%%a.mp4")> %%a.avs

But that had extra .mp4 at the end. so i just delted the .mp4 in above as to get

@echo off

for %%a in ("*.mp4") do echo.>"J:\=Backup Files\testing\%%a.avs"

for %%a in ("*.mp4") do @echo DirectShowSource("%%a")> %%a.avs

does that look ok to everyone?


Edit 2.

I've tried the following.

@echo off

echo.>"J:\=Backup Files\testing\%%a.avs"

@echo DirectShowSource("%%a.mp4")> %%a.avs

That only produces an avs file named %a.avs, and in it, is

DirectShowSource("%a.mp4")

how do i modify this so that it will generate avs for each mp4 files and with the name of the mp4 file appened within the parenthesis on the DirectShowSource command


I need to automatically generate a number of *.avs file which is a text file with its extension changed from txt to avs.

The name of the avs file needs to be the same as another movie file in the folder.

So if you have a movie called

some random movie.mp4 

the avs file needs to be named,

some random movie.avs

And the avs file needs to have the following entered in it.

 DirectShowSource("some movie name.mp4") 

I need to create this type of avs files for many movies in a folder.

I posted this 2 days ago and people put it on hold, so i'm trying it again.

I hope that's not too broad.

Thanks for any help.


This question is still too broad it seems.

Here's an example of something similar.

Create a txt file using batch file in a specific folder

The Op asks how to create text files in a folder.

@echo off

echo.>"d:\testing\dblank.txt"

is one answer given. my problem is that the files needs to have an extension of avs not txt.

Then another posts in the same thread,

@echo off

@echo>"d:\testing\dblank.txt

@echo Writing text to dblank.txt> dblank.txt

To accomplish writing some stuff to the file that's been created. My stuff that needs to be written in the files is

DirectShowSource("some movie name.mp4") 

And i need to generate that for all the movies individually with its own names replace the phrase "some movie name"

Community
  • 1
  • 1
  • 1
    Until you post actual code in the question, it will always be too broad. – SomethingDark Mar 29 '17 at 02:33
  • Something along the lines with this http://stackoverflow.com/questions/21381705/create-a-txt-file-using-batch-file-in-a-specific-folder I'll edit the question with that link – bo reddude Mar 29 '17 at 02:37
  • Ok. Just to be clear: do you want that `for` each file `%%a in` the `(*.mp4)` set of files `do` this: `echo` the `DirectShowSource("...")` string with the `%%a` name of the file `>` into another file with the same `%%~Na` name only, but `.avs` extension? – Aacini Mar 29 '17 at 11:54
  • That sounds about right, though I am confused about the %%a stuff. but I think that' supposed to be a place holder for a file name? if so, then yeah, that's what I need. – bo reddude Mar 29 '17 at 20:44
  • About your Edit 3: just change the last `> %%a.avs` by `> "%%~Na.avs"`. If the file name have spaces, like `some random movie.mp4`, then the whole name must be enclosed in quotes. Also, the `~N` _modifier_ eliminates the original `.mp4` extension. – Aacini Apr 05 '17 at 04:08
  • `@echo off` `for %%a in ("*.mp4") do echo.> %%a.avs` `for %%a in ("*.mp4") do @echo DirectShowSource("%%a")> "%%~Na.avs"` Produces 2 files. one with p[roper code in it and another which is blank. Not sure what I did wrong... – bo reddude Apr 06 '17 at 02:21

0 Answers0