I'm new to WMI/C# using the System.Management namespace.
basically, I want to retrieve a list of files from a remote computer (local network). I can get this done but the next stage is to copy a specific file over from the computer to a local folder....
how would I do this?
Code:System.Text.StringBuilder sb = new StringBuilder();
ConnectionOptions oConn = new ConnectionOptions();
ManagementScope scope = new ManagementScope("\\\\server\\root\\cimv2", oConn);
sb.Append("SELECT * FROM CIM_Datafile WHERE Extension = 'config'");
ObjectQuery oQuery = new ObjectQuery(sb.ToString());
ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(scope, oQuery);
ManagementObjectCollection oReturnCollection = oSearcher.Get();
int rowCount = 0;
foreach (ManagementObject oReturn in oReturnCollection)
{
rowCount++;
MessageBox.Show(oReturn["Name"].ToString());
}
