Computing.Net > Forums > Programming > how can i get just the filename

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how can i get just the filename

Reply to Message Icon

Name: mutaz
Date: January 8, 2009 at 04:32:57 Pacific
OS: Windows XP
CPU/Ram: Core 2 Due 2.53, 2GB of RAM
Product: Intel core 2 due / INTEL 2.13 GHZ
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: reno
Date: January 8, 2009 at 04:46:58 Pacific
Reply:

-ac 1 "F:\Clean\%%~nc.flv"


0

Response Number 2
Name: mutaz
Date: January 8, 2009 at 04:57:36 Pacific
Reply:

thanx alot alot alot alot alot.....
what i was doing is that i just put one % not %
thanx alot again and again and again


0

Response Number 3
Name: mutaz
Date: January 8, 2009 at 06:02:02 Pacific
Reply:

One another thing.....
What does the CALL function return?????
because i want to know if the converting is done successfully or not


0

Response Number 4
Name: reno
Date: January 8, 2009 at 06:25:22 Pacific
Reply:

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.


0

Response Number 5
Name: mutaz
Date: January 10, 2009 at 02:51:35 Pacific
Reply:

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.


0

Related Posts

See More



Response Number 6
Name: reno
Date: January 10, 2009 at 06:34:10 Pacific
Reply:

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"


0

Response Number 7
Name: mutaz
Date: January 11, 2009 at 00:37:38 Pacific
Reply:

thanx alot again and again


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: how can i get just the filename

how can I get log file out of this? www.computing.net/answers/programming/how-can-i-get-log-file-out-of-this/17091.html

batch file string parsing www.computing.net/answers/programming/batch-file-string-parsing/16603.html

HOW CAN I RUN UNIX COMMANDS in VB6? www.computing.net/answers/programming/how-can-i-run-unix-commands-in-vb6/14264.html