Batch File --- need help
|
Original Message
|
Name: litak
Date: November 1, 2007 at 22:07:22 Pacific
Subject: Batch File --- need helpOS: Windows XPCPU/Ram: 1GBModel/Manufacturer: intel |
Comment: Hi All, I am new in writing windows batch file. I am facing a problem and not able to solve it, so please help me out. My problem is --- I need to rename all files of the form *.mp4.ts in an input folder to only *.ts. i.e. if the file name is "a.mp4.ts" after renaming it will be "a.ts" in the same folder. Batch file will take only the input folder as an input. Thanks in advance... regards litak
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Mechanix2Go
Date: November 2, 2007 at 00:52:10 Pacific
Subject: Batch File --- need help |
Reply: (edit)@echo off setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in ('dir/b/a-d *.mp4.ts') do ( set name=%%~Na set name=!name:~0,-4! echo ren %%a !name!.ts )
===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: litak
Date: November 2, 2007 at 05:05:00 Pacific
Subject: Batch File --- need help |
Reply: (edit)Thanks for the reply... In the mean time I made another solution... FOR %%i IN (*.*.ts) DO (FOR %%j IN (%%~ni) DO (REN %%i %%~nj.ts)) and it works for me... !!! Anyway thanks for the help... litak
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: