疯狂

STANDING ON THE SHOULDERS OF GIANTS
posts - 481, comments - 486, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

cmd 传参数例子

Posted on 2010-02-06 22:07 疯狂 阅读(2190) 评论(1)  编辑  收藏 所属分类: java
  • import java.io.IOException;   
  •   
  • public class TestMencoder {   
  •        
  •     public static void main(String[] args) {   
  •         String outPath="e:\\output\\o1.flv";  //输出的文件路径   
  •         String inPath="e:\\74.2.mpg";  //要转换的视频文件路径   
  •         String cmd4="e:\\test_par.bat " + inPath+ " "+outPath;   
  •         try {   
  •             Process pr=Runtime.getRuntime().exec(cmd4);   
  •                
  •             pr.getInputStream();   
  •             System.out.println(cmd4);   
  •         } catch (IOException e) {   
  •             // TODO Auto-generated catch block   
  •             e.printStackTrace();   
  •         }   
  •     }   
  •   
  • }  
  • bat文件
  • cmd /c start D:\foresee\workspace3.2\rr\ffmpeg\ffmpeg.exe -i %1 -y -ab 32 -ar 11025 -b 400000 -s 320*240 %2  
  •   
  • echo 完成!   
  •   
  • echo. & pause 
  •  

     


    评论

    # re: cmd 传参数例子[未登录]  回复  更多评论   

    2013-10-29 14:34 by 111
    你这哪有传参,传参方法中有两个参数

    只有注册用户登录后才能发表评论。


    网站导航: