Howdy, Stranger!

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

Categories

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

Acke_narciAcke_narci Member Posts: 7
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

  • IllcoIllco Member Posts: 382
    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?
  • Acke_narciAcke_narci Member Posts: 7
    : 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. :)
  • Andre YoungAndre Young USAMember Posts: 0

    ___ / http://forcoder.org / free ebooks and video tutorials about / PHP, C, Visual Basic, Perl, Visual Basic .NET, PL/SQL, C#, MATLAB, JavaScript, C++, Ruby, Delphi, Assembly, R, Swift, Python, Objective-C, Scratch, Java, Go D, SAS, Logo, Ada, Erlang, COBOL, Fortran, Rust, Hack, Dart, Crystal, ML, Alice, ABAP, VBScript, Apex, Scheme, Prolog, Lua, Clojure, Lisp, FoxPro, Transact-SQL, LabVIEW, Scala, Awk, Bash, Kotlin, Julia, F# / _____________

Sign In or Register to comment.