{"id":8426,"date":"2017-05-10T16:30:04","date_gmt":"2017-05-10T07:30:04","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=8426"},"modified":"2017-05-11T09:45:16","modified_gmt":"2017-05-11T00:45:16","slug":"%e3%80%8c%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0%e3%81%a8%e6%a9%9f%e8%83%bd%e3%80%8d%e3%81%8b%e3%82%89%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%95%e3%82%8c%e3%81%a6%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=8426","title":{"rendered":"\u300c\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u6a5f\u80fd\u300d\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308bVBScript"},"content":{"rendered":"<p>\u4eca\u56de\u3082VBScript\u30cd\u30bf\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u300c\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u6a5f\u80fd\u300d\u304b\u3089\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nDim itm\r\n\r\nWith CreateObject(&quot;Shell.Application&quot;).Namespace(&quot;shell:::{7b81be6a-ce2b-4676-a29e-eb907a5126c5}&quot;)\r\n  For Each itm In .Items\r\n    WScript.Echo itm.Name\r\n  Next\r\nEnd With<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsInstalledApplication_01.jpg\" alt=\"\" width=\"499\" height=\"326\" class=\"alignnone size-full wp-image-8427\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsInstalledApplication_01.jpg 499w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsInstalledApplication_01-300x196.jpg 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/p>\n<p>\u4ed5\u7d44\u307f\u306f\u300c<a href=\"https:\/\/www.ka-net.org\/blog\/?p=6250\" title=\"AppUserModelId(AUMID)\u3092\u5217\u6319\u3059\u308bVBScript | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">AppUserModelId(AUMID)\u3092\u5217\u6319\u3059\u308bVBScript<\/a>\u300d\u3068\u540c\u3058\u3067\u3001\u300c\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u6a5f\u80fd\u300d\u3092\u30d5\u30a9\u30eb\u30c0\u3068\u3057\u3066\u6271\u3044\u3001\u4e2d\u306b\u3042\u308b\u30a2\u30a4\u30c6\u30e0(FolderItem2)\u306e\u540d\u524d\u3092\u5217\u6319\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3082\u7c21\u5358\u306b\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n(\u540d\u524d\u3060\u3051\u3067\u5224\u65ad\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u6b63\u78ba\u6027\u306b\u6b20\u3051\u308b\u5834\u5408\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c)<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nMsgBox IsInstalledApplication(&quot;ABCDEFG&quot;) '\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u7a7a\u306e\u6587\u5b57\u5217\u304c\u8fd4\u308b\r\nMsgBox IsInstalledApplication(&quot;7-Zip&quot;) '\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\u304c\u8fd4\u308b\r\n\r\nPrivate Function IsInstalledApplication(ByVal AppName)\r\n'\u6307\u5b9a\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u5224\u5225\r\n  Dim ret\r\n  Dim itm\r\n  \r\n  ret = &quot;&quot; '\u521d\u671f\u5316\r\n  With CreateObject(&quot;Shell.Application&quot;).Namespace(&quot;shell:::{7b81be6a-ce2b-4676-a29e-eb907a5126c5}&quot;)\r\n    For Each itm In .Items\r\n      If InStr(LCase(itm.Name), LCase(AppName)) Then\r\n        ret = itm.Name\r\n        Exit For\r\n      End If\r\n    Next\r\n  End With\r\n  IsInstalledApplication = ret\r\nEnd Function<\/pre>\n<p><a href=\"https:\/\/support.microsoft.com\/ja-jp\/help\/821775\/how-to-enumerate-the-software-products-that-can-be-uninstalled-on-a-computer\" title=\"\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u3067\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u88fd\u54c1\u3092\u5217\u6319\u3059\u308b\u65b9\u6cd5\" target=\"_blank\">\u30ec\u30b8\u30b9\u30c8\u30ea\u306b\u3042\u308b\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u60c5\u5831<\/a>\u304b\u3089\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nMsgBox IsInstalledApplication(&quot;ABCDEFG&quot;) '\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u7a7a\u306e\u6587\u5b57\u5217\u304c\u8fd4\u308b\r\nMsgBox IsInstalledApplication(&quot;7-Zip&quot;) '\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\u304c\u8fd4\u308b\r\n\r\nPrivate Function IsInstalledApplication(ByVal AppName)\r\n'\u6307\u5b9a\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u5224\u5225\r\n  Dim reg\r\n  Dim keys\r\n  Dim key\r\n  Dim ret\r\n  Dim res\r\n  Dim display_name\r\n  Const HKEY_CURRENT_USER = &amp;H80000001\r\n  Const HKEY_LOCAL_MACHINE = &amp;H80000002\r\n  Const SubKeyName = &quot;Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\&quot;\r\n  Const SubKeyNameX86 = &quot;Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\&quot;\r\n  \r\n  res = &quot;&quot; '\u521d\u671f\u5316\r\n  Set reg = CreateObject(&quot;WbemScripting.SWbemLocator&quot;) _\r\n            .ConnectServer(, &quot;root\\default&quot;).Get(&quot;StdRegProv&quot;)\r\n  \r\n  On Error Resume Next\r\n  reg.EnumKey HKEY_LOCAL_MACHINE, SubKeyName, keys\r\n  For Each key In keys\r\n    display_name = &quot;&quot;\r\n    ret = reg.GetStringValue(HKEY_LOCAL_MACHINE, SubKeyName &amp; key, &quot;DisplayName&quot;, display_name)\r\n    If ret &lt;&gt; 0 Then ret = reg.GetStringValue(HKEY_LOCAL_MACHINE, SubKeyName &amp; key, &quot;QuietDisplayName&quot;, display_name)\r\n    If (ret = 0) And (Len(Trim(display_name)) &gt; 0) Then\r\n      If InStr(LCase(display_name), LCase(AppName)) Then\r\n        res = display_name\r\n        Exit For\r\n      End If\r\n    End If\r\n  Next\r\n  On Error GoTo 0\r\n  \r\n  '64\u30d3\u30c3\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u7121\u3044\u5834\u5408\u306f32\u30d3\u30c3\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u691c\u7d22\r\n  If (Isx64() = True) And (Len(Trim(res)) &lt; 1) Then\r\n    On Error Resume Next\r\n    reg.EnumKey HKEY_LOCAL_MACHINE, SubKeyNameX86, keys\r\n    For Each key In keys\r\n      display_name = &quot;&quot;\r\n      ret = reg.GetStringValue(HKEY_LOCAL_MACHINE, SubKeyNameX86 &amp; key, &quot;DisplayName&quot;, display_name)\r\n      If ret &lt;&gt; 0 Then ret = reg.GetStringValue(HKEY_LOCAL_MACHINE, SubKeyNameX86 &amp; key, &quot;QuietDisplayName&quot;, display_name)\r\n      If (ret = 0) And (Len(Trim(display_name)) &gt; 0) Then\r\n        If InStr(LCase(display_name), LCase(AppName)) Then\r\n          res = display_name\r\n          Exit For\r\n        End If\r\n      End If\r\n    Next\r\n    On Error GoTo 0\r\n  End If\r\n  \r\n  'HKLM\u306b\u7121\u3044\u5834\u5408\u306fHKCU\u3092\u691c\u7d22\r\n  If Len(Trim(res)) &lt; 1 Then\r\n    On Error Resume Next\r\n    reg.EnumKey HKEY_CURRENT_USER, SubKeyName, keys\r\n    For Each key In keys\r\n      display_name = &quot;&quot;\r\n      ret = reg.GetStringValue(HKEY_CURRENT_USER, SubKeyName &amp; key, &quot;DisplayName&quot;, display_name)\r\n      If ret &lt;&gt; 0 Then ret = reg.GetStringValue(HKEY_CURRENT_USER, SubKeyName &amp; key, &quot;QuietDisplayName&quot;, display_name)\r\n      If (ret = 0) And (Len(Trim(display_name)) &gt; 0) Then\r\n        If InStr(LCase(display_name), LCase(AppName)) Then\r\n          res = display_name\r\n          Exit For\r\n        End If\r\n      End If\r\n    Next\r\n    On Error GoTo 0\r\n  End If\r\n  \r\n  IsInstalledApplication = res\r\nEnd Function\r\n\r\nPrivate Function Isx64()\r\n'64\u30d3\u30c3\u30c8\u74b0\u5883\u304b\u3069\u3046\u304b\u3092\u5224\u5225\r\n  Dim colItems\r\n  Dim itm\r\n  Dim ret\r\n   \r\n  ret = False '\u521d\u671f\u5316\r\n  Set colItems = CreateObject(&quot;WbemScripting.SWbemLocator&quot;).ConnectServer.ExecQuery(&quot;Select * From Win32_OperatingSystem&quot;)\r\n  For Each itm In colItems\r\n    If InStr(itm.OSArchitecture, &quot;64&quot;) Then\r\n      ret = True\r\n      Exit For\r\n    End If\r\n  Next\r\n  Isx64 = ret\r\nEnd Function<\/pre>\n<p>\u305f\u3060\u3057\u3001\u3053\u3061\u3089\u306e\u65b9\u6cd5\u3067\u53d6\u5f97\u3067\u304d\u308b\u306e\u306fUninstall\u30ad\u30fc\u4ee5\u4e0b\u306b\u60c5\u5831\u304c\u3042\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u307f\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"\u4eca\u56de\u3082VBScript\u30cd\u30bf\u3067\u3059\u3002 \u4eca\u56de\u306f\u300c\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u6a5f\u80fd\u300d\u304b\u3089\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002 Option Explicit Dim itm With Create [&hellip;]","protected":false},"author":1,"featured_media":7132,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[\u300c\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u6a5f\u80fd\u300d\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308bVBScript]","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":[25,6,125],"tags":[],"class_list":["post-8426","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows","category-vbs","category-clientmanagement"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-VBScript.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-2bU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8426","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=8426"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8426\/revisions"}],"predecessor-version":[{"id":8429,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8426\/revisions\/8429"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7132"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}