Solved

How to launch a notepad at runtime

Posted on 1997-11-10
1
580 Views
Last Modified: 2006-11-17
Hi
   I have a requirement of Launching a Notepad from a Java
application at Run Time, and write on some message on to that Notepad. How to do that?

I have used following command
try
{
   Runtime.getRuntime.exec("notepad");
}
catch(Exception e)
{}

exec() method returns me a Process. But i am not able to get any reference of that notepad so that i can write into that.

Will any body explain me with full code how to do that.

regards
0
Comment
Question by:sadik102097
1 Comment
 
LVL 3

Accepted Solution

by:
gwalters earned 50 total points
Comment Utility
You'll have to create a file containing what you want in notepad, then pass that file as an argument.

FileOutputStream out=new FileOutputStream("tempfile");
...
out.close();
Runtime.getRuntime.exec("notepad tempfile");



0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

772 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

10 Experts available now in Live!

Get 1:1 Help Now