How do i run a command line exe from within visual basic passing parameters to it?

Posted on 2008-11-05
Medium Priority
Last Modified: 2013-11-18
Okay, what i'm doing here is working on a program that needs to use ffmpeg to convert a wma file to mp3.
what i'm needing to do though is call something like this from within my VB application.

C:\ffmpeg.rev12665>ffmpeg -i test.wma -vn -f wav - | lame --resample 32 -
b 40 -B 40 --cbr -f --priority 4 -m s - test.mp3

i simply need VB to be able to launch that externally basically.

i really need to convert the wma samplerate to different samples like 22,050 so flash will stream it properly.
i would purchase something to get this done and i was looking at this:


only problem with that is that it doesn't allow you to change the sample rate for mp3...only wav.

can anyone help me with this or know of an activex object i can purchase that will do this?
Question by:linuxrox
LVL 11

Accepted Solution

Antagony1960 earned 2000 total points
ID: 22887727

Expert Comment

ID: 22911846
if all you want to do is run it externally, use the shell command:


replace the C:\Users\ with the path

Author Comment

ID: 23029993
Hey, I tried the following and this doesn't work:

ShellExecute Me.hwnd, vbNullString, "C:\ffmpeg.rev12665\ffmpeg.exe", "-i C:\ffmpeg.rev12665\localbreak2.wma -vn -f wav - | C:\ffmpeg.rev12665\lame --resample 22.05 -b 40 -B 40 --cbr -f --priority 4 -m s - C:\ffmpeg.rev12665\localbreak2.mp3", "C:\ffmpeg.rev12665\", SW_SHOWNORMAL

but when i paste this into a command prompt it does work:

C:\ffmpeg.rev12665\ffmpeg.exe -i C:\ffmpeg.rev12665\localbreak2.wma -vn -f wav - | C:\ffmpeg.rev12665\lame --resample 22.05 -b 40 -B 40 --cbr -f --priority 4 -m s - C:\ffmpeg.rev12665\localbreak2.mp3

any ideas?

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month17 days, 13 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question