try {
string path = request.getrealpath("/");
string file = path +"database/dbbackup.cmd";
process p = runtime.getruntime().exec("cmd /k start "+file);
log.error(p.getinputstream());
log.error(p.geterrorstream());
e.printstacktrace();
}
你的目的是什么,第一句是想把a.doc里面的内容复制到b.doc,然后打开b.doc这个文档吗??
如果是:那下面的代码可以实现
public class tt
{
public static void main(String args[])
{
try
{
Process process1 = Runtime.getRuntime().exec("cmd /c start copy c://c.doc d://a.doc");
Process process2 = Runtime.getRuntime().exec("cmd /c start d://a.doc");
}
catch(Exception e){System.out.println ("fdsfsd");}
}}
如果你是想打开二个WORD文档,这些代码可以实现:
public class tt
{
public static void main(String args[])
{
try
{
Process process1 = Runtime.getRuntime().exec("cmd /c start c://c.doc");
Process process2 = Runtime.getRuntime().exec("cmd /c start d://a.doc");
}
catch(Exception e){System.out.println ("fdsfsd");}
}}
二条代码我都运行通过.给分吧100分