首页 文章

nodejs用Windows模拟

提问于
浏览
0

我需要使用nodejs将文件写入运行Windows Server 2008 r2的远程计算机上受密码保护的共享文件夹,如何在.net app之类的nodejs中进行模拟操作?

Thx提前!!!

PS: Sorry for the unclear description. The folder is set to shared across the internal network on the remote windows server system, the folder is set to "readonly" for the windows account explicitly created by the admin. The nodejs server is on the same internal network and need to access the remote shared folder, thus I think nodejs need to impersonate the windows account on the remote machine to read contents from the shared folder. My question is how to do the sorry for the unclear description. The folder is set to shared across the internal network on the remote windows server system, the folder is set to "readonly" for the windows account explicitly created by the admin. The nodejs server is on the same internal network and need to access the remote shared folder, thus I think nodejs need to impersonate the windows account on the remote machine to read contents from the shared folder. My question is how to do the impersonation stuff for nodejs?

1 回答

  • 1

    迟到了 - 但是因为没有接受的答案......

    您需要使用可以访问网络共享的帐户启动节点进程 . 如何完成此操作因您的设置而异 . 例如,如果您正在尝试连接到远程Windows服务器的lLinux服务器上运行节点,那么对于节点来说它不会是直截了当的 .

    然而;如果您必须以有权访问远程共享的用户身份运行您的节点脚本 . 如果您需要从代码中执行此操作,我建议您查看我的模块node-windows . 它不具体提供远程共享访问,但它允许您使用节点脚本中的其他帐户运行命令行代码 .

相关问题