|
-
September 25th, 2000, 03:34 AM
#1
Runtime.exec() and Win98 : Cannot create process
I need to call Runtime.exec("command /c copy myfile a:");
When it is executed an exception is raised with the message "Cannot create process".
This works perfectly on Windows NT 4.
Does anyone know why it behaves like this?
What can I do to make it work on Win98?
Is it a Win16 legacy problem?
Thanks very much for your help
-BT
-
September 25th, 2000, 05:44 AM
#2
Re: Runtime.exec() and Win98 : Cannot create process
Hi
This is because the actual file is called
"Xcopy.exe"
So you can run it with:
try{
Process p = Runtime.getRuntime().exec("Xcopy YourFile a:");
p.waitFor();
}catch(Exception e){
System.out.println("Error " + e);
}
Good Luck
Phill
-
September 25th, 2000, 06:08 AM
#3
Re: Runtime.exec() and Win98 : Cannot create process
Thanks, I will try that.
So according to you I don't need (mustn't) to use ...exec("command /C ...") on Win98?
-
September 25th, 2000, 06:14 AM
#4
Re: Runtime.exec() and Win98 : Cannot create process
Hi
thats right, you dont need the "command" string,
that is just the name of the parameter in
the exec method.
And I think you will find that you only need to specify the path to the file if it isnt in
your working directory.
Phill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|