开发者

How to enter a second parameter on the same command line on Windows Vista?

开发者 https://www.devze.com 2022-12-18 09:46 出处:网络
I\'m writing a Java program to simulate a command line feeder, it runs DOS commands like this : \"Java -version\" fine, but for something more complex, such as asking for a second parameter, it won\'t

I'm writing a Java program to simulate a command line feeder, it runs DOS commands like this : "Java -version" fine, but for something more complex, such as asking for a second parameter, it won't work, I roughly开发者_StackOverflow社区 remember in Unix there is something like : "abc | 123" or maybe it's "abc < 123", I wonder in Windows command prompt is there anything like that ? So for the following example :

> keytool -list -keystore myKeystore > Enter keystore password: myPW I can feed it with this : "keytool -list -keystore myKeystore | myPW" or this : "keytool -list -keystore myKeystore

What's the correct way to do it ?


Alright I figured it out, it should be like this :

keytool -list -keystore myKeystore -storepass myPW


echo "myPW" | keytool -list -keystore myKeystore

This should work for stdin (but not stderr).

0

精彩评论

暂无评论...
验证码 换一张
取 消