?
Solved

How to send output to an exec command

Posted on 2006-11-01
3
Medium Priority
?
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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