Executing notepad in jsp (WIndows 2000)
843835Nov 22 2002 — edited Nov 26 2002Hey,
I've been playing around with the Runtime API and have run into problem. I want to eventually run a C program through a JSP page, but I can't even get notepad to open successfully. Below is the entire test code that is supposed to open notepad. When I open this JSP page in Windows 2000, nothing happens. The GUI for notepad is never opened. However, I checked the task manager and there is an instance of notepad there, and when I try to end the process it gives me an error saying that access is denied. I wrote a simple java program with similar code, and I am able to successfully open notepad through it. I can't see what I'm doing wrong here. Anyone else have this problem on Windows 2000? Thanks.
<%@ page import="java.io.*" %>
<%
Runtime r = Runtime.getRuntime();
try {
Process p = r.exec("notepad");
} catch (Exception e) {
System.out.println("Error");
}
%>
<html>
...html code...
</html>
Jason