【问题标题】:Open password protected folder in file explorer using java app使用 java 应用程序在文件资源管理器中打开受密码保护的文件夹
【发布时间】:2022-01-09 16:12:36
【问题描述】:

我想通过 Windows 10 文件资源管理器中的 IP 地址打开受密码保护的 NAS 文件夹。我在 Java Eclipse 中编写代码。

我有一个小代码可以打开文件夹,但是我必须手动输入用户名和密码。

有没有办法在文件资源管理器中打开已使用给定用户名和密码进行身份验证的文件夹?

Authentication window

提前感谢您的帮助!

Runtime.getRuntime().exec("explorer.exe /n, /e, "+ip);

【问题讨论】:

标签: java authentication passwords microsoft-file-explorer


【解决方案1】:

使用“net use”命令我可以教计算机用户名和管理员进行身份验证,然后只需使用 explorer.exe 打开文件夹

String ip = "\\\\192.168.10.199";
String user = "admin";
String pw = "admin";

Runtime.getRuntime().exec("net use " + ip + " /user:" + user + " " + pw);
Runtime.getRuntime().exec("explorer.exe /n, /e, "+ip);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-08
    • 2020-08-29
    • 1970-01-01
    • 1970-01-01
    • 2021-03-28
    • 1970-01-01
    • 1970-01-01
    • 2018-10-01
    相关资源
    最近更新 更多