在64位Server 2088上执行Runtime.getRuntime()。exec()时出现java.io.IOException

时间:2013-09-18 09:47:07

标签: java io ioexception win32-process

执行此代码时出错:

Runtime.getRuntime().exec("%windir%\\system32\\RunDll32.exe shell32.dll,ShellExec_RunDLL  \"" + "C:\\test\\testcloud.txt" + "\\\"");

错误是:

java.io.IOException: CreateProcess: %windir%\system32\RunDll32.exe shell32.dll,ShellExec_RunDLL "C:\test\testcloud.txt\" error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:66)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:551)
    at java.lang.Runtime.exec(Runtime.java:418)
    at java.lang.Runtime.exec(Runtime.java:361)
    at java.lang.Runtime.exec(Runtime.java:325)
    at com.hoc.ejems2.client.frames.JDiaAttachments.loadFile(JDiaAttachments.java:666)

它在Winserver 2003上正常运行。

0 个答案:

没有答案