Alka Gupta wrote:Runtime.getRuntime().exec(new String[] { "cmd.exe", "/c", udoc.getFilename() });
This is the original code I'm trying to execute and fails on cmd.exe so I broke it to see how can I fix the cmd problem
So can we start again. The copying of cmd.exe is a red-herring and all you are trying to do is execute a 'bat' file using Runtime.exec() but it fails. Have you read all the parts of
http://www.javaworld.com/jw-12-2000/jw-1229-traps.html and implemented
ALL the recommendations? If not then do so and post the code, all the error messages, the process 'stdout' content, the process 'stderr' content and the process exit code.
Note - I use Runtime.exec() to execute 'BAT' files without problems on Windows Xp and Windows 7. The single most important thing to do is to fully read the 'stdout' and 'stderr' streams in separate threads and for diagnostic purposes one needs to print the content.
You seem to be doing this within an Applet so you must of course sign the Applet. To make it easy to
test the code
you should isolate the whole into it's own class; you can then do the basic tests without having to continually deploy the applet and clear the Applet cache. Once you have the basics working you can then use this class in the Applet.