Author Topic: Batch Processing (Command Line) issue.  (Read 689 times)


  • Newbie
  • *
  • Posts: 11
Batch Processing (Command Line) issue.
« on: March 20, 2019, 10:50:57 AM »
Hi all.

I've adapted the first command line .bat file example from (link below) to convert from mp4 to mkv container.

The only minor issue I'm having is files named something.mp4 becomes something.mp4.mkv. I've tried everything, but can't remove the
additional .mp4 from the names. I know this is how it was intended to work, but if possible I'd rather it wasn't there.

Any advice would be greatly appreciated.

« Last Edit: March 20, 2019, 10:53:18 AM by sark »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6053
Re: Batch Processing (Command Line) issue.
« Reply #1 on: March 20, 2019, 03:56:27 PM »
Perhaps this is of some help: Convert_AVI_to_MP4.bat  (check for typo)


  • Full Member
  • ***
  • Posts: 182
Re: Batch Processing (Command Line) issue.
« Reply #2 on: March 20, 2019, 09:27:05 PM »
While I normally use a FOR... IN () DO loop to phrase/extract parts of filenames, it's not strictly necessary. (Looping is good when handling multiple files.) The same parsing techniques can be used for just a single file.

For example: pharsing_test.bat 

Code: [Select]
@echo off
echo %1
echo %~n1
echo %~n1.mk4

Using any filename (it doesn't have to exist)  here's how to specify a different file extension:

Code: [Select]
D:\>pharsing_test.bat test.mp4

Here the list of parameter extensions:
« Last Edit: March 20, 2019, 09:29:28 PM by dosdan »


  • Newbie
  • *
  • Posts: 11
Re: Batch Processing (Command Line) issue.
« Reply #3 on: March 21, 2019, 02:00:43 PM »
Thanks for the responses. Will play around tonight. I'm not really sure why that .bat example included the original extension  after converting.
Figured it shouldn't be too hard too end up with something .mkv, just couldn't figure it out. Confident I can solve now.

Thanks again.