【问题标题】:MSG command from java 32 applicaiton not working in 64 bit win 7/ win 2008 server来自 java 32 应用程序的 MSG 命令在 64 位 win 7/win 2008 服务器中不起作用
【发布时间】:2014-06-25 07:23:14
【问题描述】:

我正在使用 MSG 命令[NETSEND 不再可用] 将消息从 Win 7/2008 服务器(32/64 位)发送到 Win 7/2008 服务器(32/64 位),我的 Java 应用程序是 32 位和由于某些要求(使用 java 7 update 25),不能使用 64 位。 当我在下面运行我的 java 应用程序时,场景是这样的

  1. 32 位 Win 7/2008 服务器到 32 位 Win 7/2008 - 工作
  2. 32 位 Win 7/2008 服务器到 64 位 Win 7/2008 - 工作
  3. 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();  
        }  
    }  
}

【问题讨论】:

    标签: java windows windows-7 windows-7-x64 msg


    【解决方案1】:

    问题的原因是,在 64 位系统上,32 位应用程序无法访问 windows\system32 文件夹。你会重做

    要获取 32 位版本的 msg.exe,您可以使用特殊文件夹 %WinDir%\Sysnative 来执行 msg.exe

    详情请点击此处:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187%28v=vs.85%29.aspx http://support.microsoft.com/kb/942589/en-us

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 2013-04-20
      • 1970-01-01
      • 1970-01-01
      • 2013-09-21
      • 1970-01-01
      相关资源
      最近更新 更多