{"id":1568,"date":"2012-04-03T14:05:38","date_gmt":"2012-04-03T05:05:38","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=1568"},"modified":"2013-08-19T14:15:38","modified_gmt":"2013-08-19T05:15:38","slug":"%e3%83%89%e3%83%a9%e3%83%83%e3%82%b0%e3%83%89%e3%83%ad%e3%83%83%e3%83%97%e3%81%95%e3%82%8c%e3%81%9f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e5%86%85%e5%ae%b9%e3%82%92%e3%82%af%e3%83%aa%e3%83%83","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=1568","title":{"rendered":"\u30c9\u30e9\u30c3\u30b0&#038;\u30c9\u30ed\u30c3\u30d7\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3059\u308bVBScript"},"content":{"rendered":"<p>\u300c<a href=\"\/\/www.ka-net.org\/blog\/?p=1563\" title=\"clip\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308bVBScript\" target=\"_blank\">clip\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308bVBScript<\/a>\u300d\u306e\u5fdc\u7528\u3067\u3001\u30c9\u30e9\u30c3\u30b0&#038;\u30c9\u30ed\u30c3\u30d7\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3059\u308bVBScript\u3067\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3084CSV\u30d5\u30a1\u30a4\u30eb\u3001Word\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u7b49\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5bfe\u5fdc\u5f62\u5f0f\u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nDim Args\r\nDim Cmd\r\n\r\nSet Args = WScript.Arguments\r\nIf Args.Count &lt; 1 Then\r\n  WScript.Echo &quot;\u5f53\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30c9\u30e9\u30c3\u30b0&amp;\u30c9\u30ed\u30c3\u30d7\u3057\u3066\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;\r\n  WScript.Quit\r\nEnd If\r\nWith CreateObject(&quot;Scripting.FileSystemObject&quot;)\r\n  Select Case LCase(.GetExtensionName(Args(0)))\r\n    '\u5bfe\u5fdc\u5f62\u5f0f\u306f\u9069\u5b9c\u8ffd\u52a0\r\n    Case &quot;txt&quot;, &quot;csv&quot;, &quot;vbs&quot;, &quot;js&quot;, &quot;ini&quot;, &quot;php&quot;, &quot;cgi&quot;, &quot;htm&quot;, &quot;html&quot;, &quot;xml&quot;, &quot;css&quot;\r\n      Cmd = &quot;cmd \/c &quot;&quot;clip &lt; &quot;&quot;&quot;&quot;&quot;&quot;&quot; &amp; Args(0) &amp; &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;\r\n      CreateObject(&quot;WScript.Shell&quot;).Run Cmd, 0\r\n    'Word\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u5834\u5408\r\n    Case &quot;doc&quot;, &quot;docx&quot;, &quot;docm&quot;, &quot;rtf&quot;\r\n      CopyWordDocument Args(0)\r\n    Case Else\r\n      If Len(.GetExtensionName(Args(0))) &lt; 1 Then\r\n        If Lcase(TypeName(Args(0))) = &quot;string&quot; Then\r\n          Cmd = &quot;cmd \/c &quot;&quot;echo &quot; &amp; Args(0) &amp; &quot;| clip&quot;&quot;&quot;\r\n          CreateObject(&quot;WScript.Shell&quot;).Run Cmd, 0\r\n        End If\r\n      Else\r\n        WScript.Echo &quot;\u672a\u5bfe\u5fdc\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u3067\u3059\u3002&quot;\r\n        WScript.Quit\r\n      End If\r\n  End Select\r\nEnd With\r\nSet Args = Nothing\r\nWScript.Echo &quot;\u5185\u5bb9\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3057\u305f\u3002&quot;\r\n\r\nPrivate Sub CopyWordDocument(ByVal FilePath)\r\n'Word\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30b3\u30d4\u30fc\r\n  With CreateObject(&quot;Word.Application&quot;)\r\n    .Visible = False\r\n    With .Documents.Open(FilePath, False, True)\r\n      .Content.Copy\r\n      .Close 0\r\n    End With\r\n    .Quit 0\r\n  End With\r\nEnd Sub<\/pre>\n<p>\u300c<span style=\"color: #ff0000; font-weight: bold;\">cscript (\u30d5\u30a1\u30a4\u30eb\u540d).vbs ABC<\/span>\u300d\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089\u5f15\u6570\u3068\u3057\u3066\u6587\u5b57\u5217\u3092\u6e21\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/File2Clip_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/File2Clip_01-300x218.jpg\" alt=\"\" title=\"File2Clip_01\" width=\"300\" height=\"218\" class=\"alignnone size-medium wp-image-1569\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/File2Clip_01-300x218.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/File2Clip_01-290x210.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/File2Clip_01-150x109.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/File2Clip_01.jpg 677w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u300cclip\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308bVBScript\u300d\u306e\u5fdc\u7528\u3067\u3001\u30c9\u30e9\u30c3\u30b0&#038;\u30c9\u30ed\u30c3\u30d7\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3059\u308bVBScript\u3067\u3059\u3002 \u4e0b\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb [&hellip;]","protected":false},"author":1,"featured_media":7132,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[139],"class_list":["post-1568","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vbs","tag-vbs"],"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-pi","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1568","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=1568"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1568\/revisions"}],"predecessor-version":[{"id":1572,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1568\/revisions\/1572"}],"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=1568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}