`
zhijin
  • 浏览: 74577 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

java 调用bat文件

阅读更多

 

import java.io.*;
import java.util.*;

public class TestExec ...{   
    
public void runbat(int timeFortmat) ...{
        String cmd 
= "cmd /c start D:/ScheduleRun/data/"+timeFortmat+".bat";

        
try ...{
            Process ps 
= Runtime.getRuntime().exec(cmd);
            System.out.println(ps.getInputStream());
        }
 catch(IOException ioe) ...{
            ioe.printStackTrace();
        }

    }
          
    
    
public static void main(String[] args)...{
           TestExec  test1 
= new TestExec ();           
           test1.runbat(
1340);
    }

}
     

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics