starting a file from java with inparameters for the .exe -file

Hi.

I want to run a program with from java written in c++ and add a inparameter in the run program execution line..

To start a program in java you can run it with:
try{
Process p = Runtime.getRuntime().exec ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+fileName);

}catch(Exception e){
System.out.println(e);
}

But the c++ program id3.3x3 needs the path to a mp3 as inparameter. Like this :
fileName = "F:Mina dokumentProject4id3.exe F:musikmyMp3.mp3"...

This filename i cant however set in the runtime fileName...

How am i supposed to do??

Thanks

Comments

  • I don't know what you mean by an inparameter actually. But why can't you set it to the value you listed above? You could retrieve the path and then put it in the filename variable?
  • : I don't know what you mean by an inparameter actually. But why can't you set it to the value you listed above? You could retrieve the path and then put it in the filename variable?
    :

    The problem is that if i write the filename as i did in the exampel the == Process p = Runtime.getRuntime().exec ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+fileName);
    will say that it cant open a file named that way...
    So i dont know what to do.. =(
    Plezz help. :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories