?
Solved

How to send output to an exec command

Posted on 2006-11-01
3
Medium Priority
?
224 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 800 total points
ID: 17852124
Call getOutputStream on the Process and println Y to it
0
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 400 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 800 total points
ID: 17852838
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This video teaches viewers about errors in exception handling.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 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