Beispiel #1
0
        public static int Main(string[] args)
        {
            ManagementClass dummyClass = new ManagementClass("root/default", "", null);

            dummyClass.SystemProperties["__CLASS"].Value = "TestMyCopyToClass";
            PropertySet mykeyprop = dummyClass.Properties;

            mykeyprop.Add("reg_prop", "string_prop");
            mykeyprop.Add("MyKey", "Hello");
            dummyClass.Put();
            ManagementPath myPath = new ManagementPath("root/cimv2");
            // CopyTo( )
            ManagementPath newPath = dummyClass.CopyTo(myPath);

            Console.WriteLine(newPath.Path);
            return(0);
        }