P
paul brown
Hi there,
I'm trying to do something i've done many times before without problem, even
from signed applets...
trying to run a system command from Java.
I'm doing this:
import java.io.*;
public class SysCommand{
public static void main(Stirng[] args){
try{
Process proc =
Runtime.getRuntime().exec(
new String[]{"command.com",
"/C",
"echo",
"%windir%"});
BufferedReader reader =
new BufferedReader(
new InputStreamReader(
proc.getInputStream()));
System.out.println(reader.readLine());
proc.waitFor();
proc.destroy();
}
catch(Throwable th){
th.printStackTrace();
}
}
}
I'm trying to find out where the Windows directory is (i need to copy some
DLL's into there as part of an installation process).
When i run this, Windows raises a dialog box saying:
_______________________________________________________________
|16 bit MS-DOS Subsystem
|
|
|
| C:\WINNT\system32\ntvdm.exe
|
| Error while setting up environment for the application. Click 'Close'
to terminate |
---------------------------------------------------------------------------
---------
I'm running JDK 1.4.2_02 on a Win2K box.
Any ideas?
Thanks,
Paul
I'm trying to do something i've done many times before without problem, even
from signed applets...
trying to run a system command from Java.
I'm doing this:
import java.io.*;
public class SysCommand{
public static void main(Stirng[] args){
try{
Process proc =
Runtime.getRuntime().exec(
new String[]{"command.com",
"/C",
"echo",
"%windir%"});
BufferedReader reader =
new BufferedReader(
new InputStreamReader(
proc.getInputStream()));
System.out.println(reader.readLine());
proc.waitFor();
proc.destroy();
}
catch(Throwable th){
th.printStackTrace();
}
}
}
I'm trying to find out where the Windows directory is (i need to copy some
DLL's into there as part of an installation process).
When i run this, Windows raises a dialog box saying:
_______________________________________________________________
|16 bit MS-DOS Subsystem
|
|
|
| C:\WINNT\system32\ntvdm.exe
|
| Error while setting up environment for the application. Click 'Close'
to terminate |
---------------------------------------------------------------------------
---------
I'm running JDK 1.4.2_02 on a Win2K box.
Any ideas?
Thanks,
Paul