{"id":5364,"date":"2016-05-06T09:03:43","date_gmt":"2016-05-06T00:03:43","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5364"},"modified":"2016-05-06T09:03:43","modified_gmt":"2016-05-06T00:03:43","slug":"specialfolder","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/specialfolder\/","title":{"rendered":"\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\u3092\u53d6\u5f97\uff08wsh.SpecialFolders\uff09"},"content":{"rendered":"<h2>CreateObject \u95a2\u6570\uff1a\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\u3092\u53d6\u5f97\uff08WSH.SpecialFolders\uff09<\/h2>\n<div class=\"m30-l\">\n<p><strong>Windows Scripting Host\uff08WSH\uff09<\/strong>\u306e<strong>SpecialFolders \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u3092\u4f7f\u3046\u3068\u3001Windows \u306e\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\uff08\u30de\u30a4\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3084\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306a\u3069\uff09\u306e\u30d1\u30b9\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<strong>WSH<\/strong> \u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001<strong>CreateObject \u95a2\u6570<\/strong> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u69cb\u6587\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c<em>name<\/em> \u3067\u6307\u5b9a\u3057\u305f\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u3092\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <strong>Dim<\/strong> <em>wsh<\/em> [ <strong>As Object<\/strong> ]<br \/>\n    <strong>Set<\/strong> <em>wsh<\/em> = <strong>CreateObject<\/strong> (&#8220;WScript.Shell&#8221;)<br \/>\n    <em>path<\/em> = <em>wsh<\/em>.<strong>SpecialFolders<\/strong>(<em>findex<\/em>)<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>wsh&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;Windows Scripting Host\uff08WSH\uff09\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/li>\n<li>findex&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u53d6\u5f97\u3057\u305f\u3044\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\uff08\u6587\u5b57\u5217\u307e\u305f\u306f\u5024\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\u203b \u6587\u5b57\u5217\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001<strong>&#8220;<\/strong> \u3067\u56f2\u307f\u307e\u3059\uff08&#8221;AllUsersDesktop&#8221;\uff09\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"200\" bgcolor=\"#ffffccc\"><strong>\u6587\u5b57\u5217<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"370\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">AllUsersDesktop<\/td>\n<td width=\"80\" align = \"center\">0<\/td>\n<td width=\"370\">\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5171\u901a\u306e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">AllUsersStartMenu<\/td>\n<td width=\"80\" align = \"center\">1<\/td>\n<td width=\"370\">\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5171\u901a\u306e\u30b9\u30bf\u30fc\u30c8\u30e1\u30cb\u30e5\u30fc<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">AllUsersPrograms<\/td>\n<td width=\"80\" align = \"center\">2<\/td>\n<td width=\"370\">\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5171\u901a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30e1\u30cb\u30e5\u30fc<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">AllUsersStartup<\/td>\n<td width=\"80\" align = \"center\">3<\/td>\n<td width=\"370\">\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5171\u901a\u306e\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Desktop<\/td>\n<td width=\"80\" align = \"center\">4<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">AppData<\/td>\n<td width=\"80\" align = \"center\">5<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30a2\u30d7\u30ea\u7528\u30c7\u30fc\u30bf<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">PrintHood<\/td>\n<td width=\"80\" align = \"center\">6<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30d7\u30ea\u30f3\u30bf<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Templates<\/td>\n<td width=\"80\" align = \"center\">7<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u65b0\u898f\u4f5c\u6210\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Fonts<\/td>\n<td width=\"80\" align = \"center\">8<\/td>\n<td width=\"370\">\u30d5\u30a9\u30f3\u30c8<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">NetHood<\/td>\n<td width=\"80\" align = \"center\">9<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Desktop<\/td>\n<td width=\"80\" align = \"center\">10<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">StartMenu<\/td>\n<td width=\"80\" align = \"center\">11<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30b9\u30bf\u30fc\u30c8\u30e1\u30cb\u30e5\u30fc<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">SendTo<\/td>\n<td width=\"80\" align = \"center\">12<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u9001\u308b<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Recent<\/td>\n<td width=\"80\" align = \"center\">13<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u6700\u8fd1\u4f7f\u3063\u305f\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Startup<\/td>\n<td width=\"80\" align = \"center\">14<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Favorites<\/td>\n<td width=\"80\" align = \"center\">15<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u304a\u6c17\u306b\u5165\u308a<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">MyDocuments<\/td>\n<td width=\"80\" align = \"center\">16<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30de\u30a4\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">Programs<\/td>\n<td width=\"80\" align = \"center\">17<\/td>\n<td width=\"370\">\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30e1\u30cb\u30e5\u30fc<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>path&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<em>findex<\/em> \u3067\u6307\u5b9a\u3057\u305f\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>Windows \u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\u53d6\u5f97 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"WSH SpecialFolders \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_SpecialFolder()\r\n\r\n    Dim wsh As Object\r\n    \r\n    Set wsh = CreateObject(\"WScript.Shell\")\r\n    \r\n    MsgBox wsh.specialfolders(\"AllUsersDesktop\") & vbCrLf & _\r\n           wsh.specialfolders(\"AllUsersStartMenu\") & vbCrLf & _\r\n           wsh.specialfolders(2) & vbCrLf & _\r\n           wsh.specialfolders(\"MyDocuments\")\r\n    \r\n    Set wsh = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/specialfolder01.jpg?ssl=1\" rel=\"lightbox[5364]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/specialfolder01.jpg?resize=419%2C200&#038;ssl=1\" alt=\"\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\" width=\"419\" height=\"200\" class=\"alignnone size-full wp-image-5365\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/specialfolder01.jpg?w=419&amp;ssl=1 419w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/specialfolder01.jpg?resize=400%2C191&amp;ssl=1 400w\" sizes=\"(max-width: 419px) 100vw, 419px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>CreateObject \u95a2\u6570\uff1a\u7279\u6b8a\u30d5\u30a9\u30eb\u30c0\u3092\u53d6\u5f97\uff08WSH.SpecialFol &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5365,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[675],"tags":[721,693,63,852,853,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/specialfolder01.jpg?fit=419%2C200&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1ow","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5364"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=5364"}],"version-history":[{"count":8,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5364\/revisions"}],"predecessor-version":[{"id":5399,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5364\/revisions\/5399"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5365"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}