简体   繁体   English

使用bat文件的命令行在Java上运行Bat文件

[英]Run a Bat File on Java with a command line for the bat file

I'm trying to run wsadmin as administrator on Java and I would like to input the jacl script with it as well. 我正在尝试以管理员身份在Java上运行wsadmin,我也想输入jacl脚本。 How do I do that? 我怎么做? This is my current code. 这是我当前的代码。

    Runtime rt = Runtime.getRuntime();
    rt.exec("cmd /c start C:\\IBM\\WebSphere\\AppServer\\profiles\\JVMSrv01\\bin\\wsadmin2.bat.lnk");

How would I input, for example, a jacl script file for it to execute right after I have run it as admin? 我将如何输入(例如)一个jacl脚本文件以使其以管理员身份运行后立即执行?

I am running the wsadmin on my profiles folder so the connection has already been established. 我在个人档案文件夹中运行wsadmin,因此连接已经建立。 Thank you! 谢谢!

wsadmin.bat - lang jacl -f filename wsadmin.bat-lang jacl -f 文件名

Also see help with -h. 另请参阅-h的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM