简体   繁体   中英

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.

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. As long as your account can access a shared folder (UNC, FTP, http, etc.) the workaround works: https://stackoverflow.com/a/11948096/1569434

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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