Windows批处理文件使用用户名和密码调用远程可执行文件

发布于 2024-08-29 22:53:38 字数 316 浏览 3 评论 0原文

您好,我正在尝试获取一个批处理文件来从服务器调用可执行文件并登录。我有一个监控程序,允许我发送和执行脚本。好吧,

//x3400/NTE_test/test.exe /USER:student password

现在这行不通了。该路径是正确的,因为当我在 xp 的运行菜单中输入它时,它可以工作。然后我手动登录并运行脚本。我怎样才能让它登录并运行我需要的exe?

第 2 部分: 有些机器已经使用保存的密码登录(手动完成)。我应该有一个命令来首先清除该密码然后登录吗?

感谢您的回复,我感谢

杰克的帮助

Hi I am trying to get a batch file to call an executable from the server and login. I have a monitoring program that allows me send and execute the script. OK here goes....

//x3400/NTE_test/test.exe /USER:student password

Now this doesn't work. The path is right because when I type it in at the run menu in xp it works. Then I manually login and the script runs. How can I get this to login and run that exe I need it to?

Part 2:
Some of the machines have already logged in with the password saved (done manually). Should I have a command to first clear that password then login?

Thanks for any replies, I appreciate the help

Jake

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅黛梨妆こ 2024-09-05 22:53:38

(注意:这个问题可能属于 serverfault.com 或 superuser.com)

如果需要进行的登录是网络共享的登录,您可以让您的脚本使用 net use 命令来执行此操作:

net use //x3400/NTE_test /USER:student password
//x3400/NTE_test/test.exe

如果登录是特定的到“test.exe”程序,那么您必须从其文档中找出如何在命令行上传递凭据。

无论哪种情况,您都需要考虑在脚本中包含用户密码的安全隐患。如果用户在 x3400 服务器上拥有与他正在运行的计算机上相同的名称和密码的帐户(或者如果 x3400 计算机与他的计算机位于同一域中),则应该有不需要他提供凭据。这可能是处理密码的更好方法。

(note: this question probably belongs on serverfault.com or superuser.com)

If the login that needs to happen is the login for the network share, you can have your script do that using the net use command:

net use //x3400/NTE_test /USER:student password
//x3400/NTE_test/test.exe

If the login is something specific to the ``test.exe` program, then you'll have to find out from its documentation how to pass credentials on the command line.

In either case, you need to consider the security implications of having a user's password in a script. If the user is has an account with the same name and password on the x3400 server as on the machine he's running on (or if the x3400 machine is in the same domain as his machine), there should be no need for him to provide credentials. This might be a better way to handle the password.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文