Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Batch to copy the name of .avi file to a .srt file

$
0
0
Hi,

I have done a batch to copy the name of a .avi file to a .srt file. The problem is that the .srt file became with the ".avi" string within the name. Example:

Before my batch file:
matrix.avi
subtitles.srt

After my batch file:
matrix.avi
matrix.avi.srt

I tried to erase the ".avi" string in the .srt file but I have no sucess. Here is the code:

@echo off
dir *.mp3 /b "C:\Batch files" >>filelist.txt


for /f "tokens=1* delims=|" %%a in (filelist.txt) do (
       
      ren *.srt "%%a".srt
)

del filelist.txt


Can someone help me please?

Viewing all articles
Browse latest Browse all 2703

Trending Articles