如何在bat文件中运行这些sh命令集? [英] How to run these set of sh commands in bat file?

查看:349
本文介绍了如何在bat文件中运行这些sh命令集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要运行此sh命令.首先,命令将是这个

I need to run this sh commands. First, the command will be this one

keytool -importcert -file myfile.cer -keystore keystore.jks -alias "Aliasname"

Enter keystore password:

Re-enter new password:

Trust this certificate? [no]:

我需要自动运行此命令,并且当第一个命令成功时.它要求输入密码.我需要自动输入.最后是. 如何使用.bat文件做到这一点?

I need to run this commands automatically, And when the first command is successful. It asks for a password. I need to enter it automatically. and finally yes. How to do that using .bat file?

推荐答案

如果keytool与标准输入兼容,则可以使用:

If keytool is compliant with standard input, you can use:

(
echo your_password
echo your_password
echo y
)|keytool -importcert -file myfile.cer -keystore keystore.jks -alias "Aliasname"

这篇关于如何在bat文件中运行这些sh命令集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆