简体   繁体   English

使用 WMI 将文件从本地计算机复制到远程计算机

[英]Copy a file from local machine to remote machine using WMI

I've tried figuring out how to copy a file from the local machine my program is running on onto a remote machine using C# and WMI (Without having to set up a share on the remote machine), but with no luck.我已经尝试弄清楚如何使用 C# 和 WMI(无需在远程计算机上设置共享)将运行我的程序的本地计算机上的文件复制到远程计算机上,但没有运气。

The source file could be on the local computer the program is running from or on share, but I do not want to have to set up a share on the destination machine.源文件可能位于程序运行的本地计算机上或共享上,但我不想在目标计算机上设置共享。

Does anyone know how I could do this?有谁知道我该怎么做?

I bashed my head on this until I found Frank White's WMI method of using CMD to create a way of doing this.直到我找到了Frank White 的 WMI 方法,该方法使用 CMD来创建一种执行此操作的方法,我才对此大发雷霆。 As long as your account can access a shared folder (UNC, FTP, http, etc.) the workaround works: https://stackoverflow.com/a/11948096/1569434只要您的帐户可以访问共享文件夹(UNC、FTP、http 等),解决方法就有效: Z5E056C500A1C4B6A7110B50D807BADE94Z://0stackoverflow.com/6/6

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM