|
Answer» Good day guys: I have a batch file and I run a command inside it to modfiy a file, but before it does the encryption it ask me first" Are you sure you want to modify this file? (y/n)" and I want to find a way to just input a standard y for yes from inside my batch file so that I can automate the process and run it from a java code, any ideas about how to do this??? is you WORK under windows xp you can set /q after your command example: del c:/test/*.* /qYou could try using the PIPE to force console input into your program:
echo y | yourencryptionprogram
Be aware that not all programs will take input from the pipe, but it's worth a try. Redirection is another option but the pipe is more efficient.
Good luck. Guys NOTHING worked, I tried everything and nothing worked, the redirecting doesnt work too, any suggestions?? LIKE it was mentioned, not all programs can take input from the pipe. Check your encryption program documentation (help file), there may be switches to allow the program to run unattended. Look for THINGS like silent or quiet mode.
Also check the program's web site. You may have an older model. You might even find a better program that meets your needs.
Good luck. You can also write a y in a textfile, (yes.txt). Sometimes it works:
yourprogrammsname uliwhat are you refering to as "the pipe"??Pipe: A hollow cylinder or tube used to conduct a liquid, gas, or finely divided solid. n.
In batch files the pipe symbol, | is used to pass the output of one command into another command. Can make for some rather creative batch coding.
|