我正在使用 MSG 命令[NETSEND 不再可用] 将消息从 Win 7/2008 服务器(32/64 位)发送到 Win 7/2008 服务器(32/64 位),而我的 Java 应用程序是 32 位,不能使用 64由于某些要求(使用 java 7 update 25)。当我在下面运行我的 java 应用程序时是这样的场景
- 32 位 Win 7/2008 服务器到 32 位 Win 7/2008 - 工作
- 32 位 Win 7/2008 服务器到 64 位 Win 7/2008 - 工作
32 位 Win 7/2008 服务器到 64 位 Win 7/2008 - 工作
4. 64 位 Win 7/2008 服务器到 64 位 Win 7/2008 - 不工作
5. 64 位 Win 7/2008 服务器到 32 位 Win 7/2008 - 不工作
是否有任何解决方法可以使这项工作在 64 位 Win 7/2008 服务器上工作?
package msgcommand;
import java.io.*;
public class TestExec {
public static void main(String[] args) {
try {
Process p = Runtime.getRuntime().exec("cmd /C MSG.exe /SERVER:127.0.0.1 * test");
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}