Solved

How to send output to an exec command

Posted on 2006-11-01
3
215 Views
Last Modified: 2010-03-31
I am trying to modify the windows registry in my application, and I am shelling out

reg add ... command.  This always asks for confirmation Y/N after you exec the command in dos.  How can I either by pass this confirmation or send it a Y character?
0
Comment
Question by:jjacksn
3 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 200 total points
ID: 17852124
Call getOutputStream on the Process and println Y to it
0
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 100 total points
ID: 17852746
I'm not sure if that will work, but I have another approach:

create a text file named <name>.reg
then execure regedit <name>.reg

The structure of that file is obtained by running regedit interactively
and using  File->export

;JOOP!
0
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 17852838
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now