{"id":5084,"date":"2014-11-25T15:01:07","date_gmt":"2014-11-25T06:01:07","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=5084"},"modified":"2014-11-25T15:01:07","modified_gmt":"2014-11-25T06:01:07","slug":"java%e3%81%aeguid%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8bvba%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=5084","title":{"rendered":"Java\u306eGUID\u3092\u53d6\u5f97\u3059\u308bVBA\u30de\u30af\u30ed"},"content":{"rendered":"<p>\u300c<a href=\"\/\/www.ka-net.org\/blog\/?p=3799\" title=\"[\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u7ba1\u7406]Adobe Reader\u3001Acrobat\u3001Flash Player\u3001JRE\u306e\u30b5\u30a4\u30ec\u30f3\u30c8\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8)\" target=\"_blank\">[\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u7ba1\u7406]Adobe Reader\u3001Acrobat\u3001Flash Player\u3001JRE\u306e\u30b5\u30a4\u30ec\u30f3\u30c8\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8)<\/a>\u300d\u3067\u3082\u66f8\u3044\u305f\u901a\u308a\u3001Java(JRE)\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d\u3067\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u30b5\u30a4\u30ec\u30f3\u30c8\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">msiexec.exe \/qn \/x {26A24AE4-039D-4CA4-87B4-2F03217067FF}<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d\u3067Msiexec.exe\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u9006\u306b\u30b5\u30a4\u30ec\u30f3\u30c8\u30fb\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u3068\u304d\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eJava\u306eGUID\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u300c<a href=\"https:\/\/www.java.com\/ja\/download\/help\/msi_install.xml\" title=\"Active Directory\u3092\u4f7f\u7528\u3057\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067Java\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u65b9\u6cd5\" target=\"_blank\">Active Directory\u3092\u4f7f\u7528\u3057\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067Java\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u65b9\u6cd5<\/a>\u300d\u306b\u3088\u308b\u3068\u3001\u3053\u306eGUID\u306f\u300c<span style=\"color: #ff0000; font-weight: bold;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products<\/span>\u300d\u4ee5\u4e0b\u3092\u8abf\u3079\u308c\u3070\u826f\u3044\u3088\u3046\u306a\u306e\u3067\u3001\u30ec\u30b8\u30b9\u30c8\u30ea\u30fc\u3092\u691c\u7d22\u3057\u3066\u5fc5\u8981\u306a\u5024\u3060\u3051\u3092\u53d6\u5f97\u3059\u308bVBA\u30de\u30af\u30ed\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub GetJavaGUID()\r\n'Java\u306eGUID\u3092\u53d6\u5f97\r\n  Dim reg As Object\r\n  Dim names As Variant\r\n  Dim elm_names As Variant\r\n  Dim elm_types As Variant\r\n  Dim display_name As String\r\n  Dim uninstall_string As String\r\n  Dim i As Long, j As Long\r\n  \r\n  Const HKEY_LOCAL_MACHINE = &amp;H80000002\r\n  Const REG_SZ = 1\r\n  Const SubKeyName As String = &quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products&quot;\r\n  \r\n  Set reg = CreateObject(&quot;WbemScripting.SWbemLocator&quot;) _\r\n            .ConnectServer(, &quot;root\\default&quot;) _\r\n            .Get(&quot;StdRegProv&quot;)\r\n  reg.EnumKey HKEY_LOCAL_MACHINE, SubKeyName, names\r\n  If Not IsNull(names) Then\r\n    On Error Resume Next\r\n    For i = LBound(names) To UBound(names)\r\n      reg.EnumValues HKEY_LOCAL_MACHINE, _\r\n                     SubKeyName &amp; ChrW(92) &amp; names(i) &amp; ChrW(92) &amp; &quot;InstallProperties&quot;, _\r\n                     elm_names, _\r\n                     elm_types\r\n      If Not IsNull(elm_names) Then\r\n        '\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u88fd\u54c1\u3092\u5217\u6319\r\n        For j = LBound(elm_names) To UBound(elm_names)\r\n          'Debug.Print elm_names(j), elm_types(j) '\u78ba\u8a8d\u7528\r\n          If LCase(elm_names(j)) = &quot;displayname&quot; And elm_types(j) = REG_SZ Then\r\n            display_name = &quot;&quot; '\u521d\u671f\u5316\r\n            reg.GetStringValue HKEY_LOCAL_MACHINE, _\r\n                               SubKeyName &amp; ChrW(92) &amp; names(i) &amp; ChrW(92) &amp; &quot;InstallProperties&quot;, _\r\n                               elm_names(j), _\r\n                               display_name\r\n            '&#x5B;DisplayName]\u306b&#x5B;Java]\u3092\u542b\u3080\u88fd\u54c1\u3060\u3051\u51e6\u7406\r\n            If InStr(LCase(display_name), &quot;java&quot;) Then\r\n              uninstall_string = &quot;&quot; '\u521d\u671f\u5316\r\n              reg.GetExpandedStringValue HKEY_LOCAL_MACHINE, _\r\n                                         SubKeyName &amp; ChrW(92) &amp; names(i) &amp; ChrW(92) &amp; &quot;InstallProperties&quot;, _\r\n                                         &quot;UninstallString&quot;, _\r\n                                         uninstall_string\r\n              Debug.Print &quot;DisplayName:&quot; &amp; display_name, &quot;UninstallString:&quot; &amp; uninstall_string\r\n            End If\r\n          End If\r\n        Next\r\n      End If\r\n    Next\r\n    On Error GoTo 0\r\n  End If\r\nEnd Sub<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetJavaGUID_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetJavaGUID_01.jpg\" alt=\"GetJavaGUID_01\" width=\"795\" height=\"77\" class=\"alignnone size-full wp-image-5085\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetJavaGUID_01.jpg 795w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GetJavaGUID_01-300x29.jpg 300w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/a><\/p>\n<p>\u300c<span style=\"color: #ff0000; font-weight: bold;\">DisplayName<\/span>\u300d\u306e\u5024\u306b\u300c<span style=\"color: #ff0000; font-weight: bold;\">Java<\/span>\u300d\u304c\u542b\u307e\u308c\u308b\u30ad\u30fc\u306e\u3001\u300c<span style=\"color: #ff0000; font-weight: bold;\">UninstallString<\/span>\u300d\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u3060\u3051\u306e\u30b6\u30c3\u30af\u30ea\u3057\u305f\u30de\u30af\u30ed\u3067\u3059\u304c\u3001\u624b\u4f5c\u696d\u3067\u884c\u3046\u3088\u308a\u306f\u65e9\u304fGUID\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3060\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300c[\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u7ba1\u7406]Adobe Reader\u3001Acrobat\u3001Flash Player\u3001JRE\u306e\u30b5\u30a4\u30ec\u30f3\u30c8\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8)\u300d\u3067\u3082\u66f8\u3044\u305f\u901a\u308a\u3001Java(JRE)\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d\u3067\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001 [&hellip;]","protected":false},"author":1,"featured_media":7110,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"JRE\u3092\u30b5\u30a4\u30ec\u30f3\u30c8\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u304d\u306b\u5f79\u7acb\u3064\u30de\u30af\u30ed\u3067\u3059\u3002 [Java\u306eGUID\u3092\u53d6\u5f97\u3059\u308bVBA\u30de\u30af\u30ed]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,125],"tags":[],"class_list":["post-5084","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-clientmanagement"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-ClientManagement.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1k0","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5084"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5084\/revisions"}],"predecessor-version":[{"id":5086,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5084\/revisions\/5086"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7110"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}