how can i get just the filename

Intel core 2 due / INTEL 2.13 GHZ
January 8, 2009 at 04:32:57
Specs: Windows XP, Core 2 Due 2.53, 2GB of RAM
see the following script:
FOR %%c in (F:\Dirty\*.*) DO (
CALL ffmpeg.exe -i %%c -ar 22050 -ab 56 -aspect 4:3 -b 200 -r 12 -f flv -s 320x240 -acodec mp3

-ac 1 F:\Clean\OUTPUT-FILE-NAME.flv
)
pause

this script is supposed to convert all vedio files in one folder to .flv and put them all in another folder.... everything is going Ok but the problem is that i don't know can i get just the file name to use it in the new folder, i mean i want to replace 'OUTPUT-FILE-NAME' with the original file name but without the extension, obviously


See More: how can i get just the filename

Report •


#1
January 8, 2009 at 04:46:58
-ac 1 "F:\Clean\%%~nc.flv"

Report •

#2
January 8, 2009 at 04:57:36
thanx alot alot alot alot alot.....
what i was doing is that i just put one % not %
thanx alot again and again and again

Report •

#3
January 8, 2009 at 06:02:02
One another thing.....
What does the CALL function return?????
because i want to know if the converting is done successfully or not

Report •

Related Solutions

#4
January 8, 2009 at 06:25:22
echo ERRORLEVEL=%errorlevel%
if not %errorlevel%==0 echo something went wrong

and i dont think you need to use the CALL statement, just type fffmpeg without call.


Report •

#5
January 10, 2009 at 02:51:35
It didn't work,
I tried it but i couldn't get the return of the function ffmpeg.....
I want to delete all the files in the first folder but i'm sure that they converted to .flv file in order not to convert them again when i run the same batch file.

Report •

#6
January 10, 2009 at 06:34:10
what's the errorlevel returned? if conversion failed and errorlevel is 0 then maybe ffmpeg.exe doesn't return errorlevel.

is there any common text output from ffmpeg.exe when error occured?

here is an alternative batch code for program not returning errorlevel:
i personally prefer to hide the original file when conversion is successful. and delete the hidden file(s) only when i am REALLY REALLY sure. but if you are the type of optimistic, change it to del %%a

pushd f:\dirty
for %%a in (*) do dir /b "f:\clean\%%~na.flv"2>nul && attrib +h "%%~a"


Report •

#7
January 11, 2009 at 00:37:38
thanx alot again and again

Report •


Ask Question