我一直在尝试编写脚本批处理文件或 exe 来执行登录。它应该执行一个基本操作——只需登录我不在网络中的 Windows 7 电脑。我有一个在后台运行的 jar 文件。我想编写一个带有密码的脚本来登录我自己的 Windows 7 电脑。
我已经研究了一些实用程序Logon.exe
上述实用程序在我的电脑中不起作用显示一些错误,例如
Windows Logon version 1.04
Copyright (c) 2003-2010 SoftTree Technologies, Inc.
Unable to install logon service (OpenSCManager failed).
Logon failed.
在某处它告诉该文件应该以管理员身份运行。
这是我的代码:
Process process = new ProcessBuilder("C:\\Logon.exe","-p","welcome").start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
而且我还尝试使用 LogonExpert 使用 AutoLogon
上述工具运行良好。但我的需要是仅在需要时使用 java 登录。
请大家帮帮我...