Avilan
Avilan

Reputation: 181

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?

Upvotes: 1

Views: 9995

Answers (1)

Lizz
Lizz

Reputation: 1470

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

Upvotes: 1

Related Questions