Program execution in java -


i trying open exe file, specificly indrirunquery.exe 1 of tools offers lemur indri package. when use command prompt write following command:

indrirunquery queries.txt 

with this, editting of queries included in queries.txt (which passed parameter in above command) starting.

then after descent amount of time has passed ,i write following in order save results produced in file named results.txt:

 indrirunquery queries.txt >results.txt 

my problem every time want edit file contains queries need same steps. have 20 different query files edit. trying find way using java program can not figure out.

i have used these lines of code doesnot work @ all. can me out this?

processbuilder builder = new processbuilder("c:\\program files\\indri\\indri 5.8\\bin\\indrirunquery.exe",              "c:\\users\\Πετρής\\desktop\\titlesrel.txt");     builder.start();     processbuilder builder2 = new processbuilder("c:\\program files\\indri\\indri 5.8\\bin\\indrirunquery.exe",              "c:\\users\\Πετρής\\desktop\\titlesrel.txt",">c:\\users\\Πετρής\\desktop\\resultsexample3.txt");      builder2.start(); 

the correct syntax below:

// create processbuilder. processbuilder p = new processbuilder(); // use command "notepad.exe" , open file. p.command("notepad.exe", "c:\\file.txt"); p.start(); 

or

process p = runtime.getruntime().exec("cmd /c start " + file.getabsolutepath()); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -