{"id":1201,"date":"2023-04-19T20:07:44","date_gmt":"2023-04-19T12:07:44","guid":{"rendered":"http:\/\/www.luwl.net\/?p=1201"},"modified":"2023-04-19T20:07:44","modified_gmt":"2023-04-19T12:07:44","slug":"wincc-%e9%80%9a%e8%bf%87vbs%e6%9d%a5%e5%90%af%e5%8a%a8windows%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"http:\/\/www.luwl.net\/?p=1201","title":{"rendered":"wincc \u901a\u8fc7vbs\u6765\u542f\u52a8windows\u670d\u52a1"},"content":{"rendered":"\r\n<p>wincc\u5224\u65ad\u7cfb\u7edf\u670d\u52a1\u8fd0\u884c\u72b6\u6001\uff0c\u91cd\u542f\u670d\u52a1\u7684\u4f8b\u5b50\uff1a<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code> If (HMIRuntime.Tags(\"@PRF_CLDCN_TAG_FAILED_WRITES_TOTAL\").Read > 0) Then\r\n \tstrComputer = \".\" \r\n\tSet objWMIService = GetObject(\"winmgmts:\\\\\" &amp; strComputer &amp; \"\\root\\cimv2\") \r\n\tSet colServiceList = objWMIService.ExecQuery _ \r\n\t    (\"Select * from Win32_Service where Name = 'CCCloudConnect'\") \r\n\tFor Each objService In colServiceList \r\n\tMsgbox(objService.State)\r\n\t    If objService.State = \"Running\" Then \r\n\t        objService.StopService() \r\n\t        Wscript.Sleep 5000\r\n\t        objService.StartService() \r\n\t    End If \r\n\t    'errReturnCode = objService.ChangeStartMode(\"Disabled\")    \r\n\tNext\r\n\tMsgbox(\"ok\")\r\n End If\r\n\r\n\r\n\r\nstrComputer = \".\"\r\n\tSet objWMIService = GetObject(\"winmgmts:\" _\r\n\t    &amp; \"{impersonationLevel=impersonate}!\\\\\" &amp; strComputer &amp; \"\\root\\cimv2\")\r\n\tSet colServiceList = objWMIService.ExecQuery _\r\n\t    (\"Select * from Win32_Service where Name='CCCloudConnect'\")\r\n\tFor each objService in colServiceList\r\n\t    errReturn = objService.StartService()\r\n\tNext\r\n\tWscript.Sleep 20000\r\n\tSet colServiceList = objWMIService.ExecQuery(\"Associators of \" _\r\n\t   &amp; \"{Win32_Service.Name='CCCloudConnect'} Where \" _\r\n\t        &amp; \"AssocClass=Win32_DependentService \" &amp; \"Role=Dependent\" )\r\n\tFor each objService in colServiceList\r\n\t    objService.StartService()\r\n\tNext\r\n\r\n<\/code><\/pre>\r\n","protected":false},"excerpt":{"rendered":"<p>wincc\u5224\u65ad\u7cfb\u7edf\u670d\u52a1\u8fd0\u884c\u72b6\u6001\uff0c\u91cd\u542f\u670d\u52a1\u7684\u4f8b\u5b50\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1201","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.luwl.net\/index.php?rest_route=\/wp\/v2\/posts\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.luwl.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.luwl.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.luwl.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.luwl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1201"}],"version-history":[{"count":1,"href":"http:\/\/www.luwl.net\/index.php?rest_route=\/wp\/v2\/posts\/1201\/revisions"}],"predecessor-version":[{"id":1202,"href":"http:\/\/www.luwl.net\/index.php?rest_route=\/wp\/v2\/posts\/1201\/revisions\/1202"}],"wp:attachment":[{"href":"http:\/\/www.luwl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.luwl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.luwl.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}