cmd - Can't execute command in java -


i want 1 of these commands executed. can't in java. commands are:

type table1.sql, table2.sql, table3.sql > sbackup.sql type *.sql > allinone.sql  --[make backup file in folder] copy *.sql merged.sql 

i tried this:

string command = "type " + "*.sql" + " --result-file=" + "c:\\sbackup.sql"; runtime.getruntime().exec(command); 

your valuable insight highly appreciated. thank you.

type , copy both built-ins in windows command shell, not actual programs can execute. execute them, execute command shell , provide command argument after /c:

string command = "cmd.exe /c type " + "*.sql" + " --result-file=" + "c:\\sbackup.sql"; runtime.getruntime().exec(command); 

...but i'll note don't think type has --result-file argument.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -