{"id":3710,"date":"2025-04-22T15:37:37","date_gmt":"2025-04-22T07:37:37","guid":{"rendered":"https:\/\/www.wjxy.net.cn\/?p=3710"},"modified":"2025-04-22T15:38:23","modified_gmt":"2025-04-22T07:38:23","slug":"vbs%e8%8e%b7%e5%8f%96%e8%ae%a1%e7%ae%97%e6%9c%ba%e4%bf%a1%e6%81%afver2-0","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=3710","title":{"rendered":"VBS\u83b7\u53d6\u8ba1\u7b97\u673a\u4fe1\u606fver2.0"},"content":{"rendered":"\n<p><strong>\u4ee5\u4e0b\u5185\u5bb9\u53e6\u5b58\u4e3axx.vbs\u5373\u53ef<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>' \u83b7\u53d6\u8ba1\u7b97\u673a\u540d\u79f0\nSet objNetwork = CreateObject(\"WScript.Network\")\ncomputerName = objNetwork.ComputerName\n\n' \u83b7\u53d6\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\nSet objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\nSet colItems = objWMIService.ExecQuery(\"Select * from Win32_OperatingSystem\")\nFor Each objItem In colItems\n    osVersion = objItem.Caption &amp; \" \" &amp; objItem.Version\nNext\n\n' \u83b7\u53d6\u8ba1\u7b97\u673a\u54c1\u724c\u578b\u53f7\nSet colComputerSystem = objWMIService.ExecQuery(\"Select * from Win32_ComputerSystem\")\nFor Each objComputerSystem In colComputerSystem\n    computerBrandModel = objComputerSystem.Manufacturer &amp; \" \" &amp; objComputerSystem.Model\nNext\n\n' \u83b7\u53d6\u78c1\u76d8\u578b\u53f7\nSet colDisks = objWMIService.ExecQuery(\"Select * from Win32_DiskDrive\")\ndiskModels = \"\"\nFor Each objDisk In colDisks\n    diskModels = diskModels &amp; objDisk.Model &amp; vbCrLf\nNext\n\n' \u83b7\u53d6 CPU \u578b\u53f7\nSet colProcessors = objWMIService.ExecQuery(\"Select * from Win32_Processor\")\ncpuModel = \"\"\nFor Each objProcessor In colProcessors\n    cpuModel = cpuModel &amp; objProcessor.Name &amp; vbCrLf\nNext\n\n' \u83b7\u53d6\u5185\u5b58\u5927\u5c0f\nSet colMemory = objWMIService.ExecQuery(\"Select * from Win32_PhysicalMemory\")\ntotalMemory = 0\nFor Each objMemory In colMemory\n    totalMemory = totalMemory + CDbl(objMemory.Capacity) ' \u4f7f\u7528 CDbl \u907f\u514d\u6ea2\u51fa\nNext\ntotalMemoryGB = Round(totalMemory \/ 1024 \/ 1024 \/ 1024, 2) &amp; \" GB\"\n\n' \u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4\ncurrentDateTime = Now\n\n' \u62fc\u63a5\u6240\u6709\u4fe1\u606f\nresult = \"\u8ba1\u7b97\u673a\u54c1\u724c\u578b\u53f7: \"&amp; vbCrLf &amp; computerBrandModel &amp; vbCrLf &amp; _\n\t\t \"\u8ba1\u7b97\u673a\u540d\u79f0: \"&amp; vbCrLf &amp; computerName &amp; vbCrLf &amp; _\n         \"\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c: \"&amp; vbCrLf &amp; osVersion &amp; vbCrLf &amp; _\n         \"CPU \u578b\u53f7: \" &amp; vbCrLf &amp; cpuModel &amp; _\n         \"\u5185\u5b58\u5927\u5c0f: \" &amp; vbCrLf &amp; totalMemoryGB &amp; vbCrLf &amp; _\n         \"\u78c1\u76d8\u578b\u53f7: \" &amp; vbCrLf &amp; diskModels &amp; vbCrLf &amp; _\n         \"\u5f53\u524d\u65e5\u671f\u65f6\u95f4: \" &amp; currentDateTime &amp; vbCrLf &amp; _\n         \"Powered by\uff1a\u82cf\u5dde\u51e1\u5353\u6587\u5316\u79d1\u6280\u6709\u9650\u516c\u53f8 \u674e\u6e9013390869205\"\n\n' \u4f7f\u7528 MsgBox \u663e\u793a\u7ed3\u679c\nMsgBox result, vbInformation, \"\u7cfb\u7edf\u4fe1\u606f\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u5185\u5bb9\u53e6\u5b58\u4e3axx.vbs\u5373\u53ef:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/3710"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3710"}],"version-history":[{"count":2,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/3710\/revisions"}],"predecessor-version":[{"id":3712,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/3710\/revisions\/3712"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}