<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>WSH/Windows Script</title><link>http://blogs.wankuma.com/mutaguchi/category/507.aspx</link><description>WSHを含むWindows Scriptに関する記事</description><managingEditor>むたぐち（牟田口大介）</managingEditor><dc:language>ja-JP</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>[WSH]Outlookのアドレス帳をnpopqのアドレス帳にエクスポートする</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/08/12/152820.aspx</link><pubDate>Tue, 12 Aug 2008 23:12:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/08/12/152820.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/152820.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/08/12/152820.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/152820.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/152820.aspx</trackback:ping><description>&lt;pre&gt;Const olFolderContacts = 10
Set Outlook = CreateObject("Outlook.Application")
Set Fs = CreateObject("Scripting.FileSystemObject")
Set ts = Fs.CreateTextFile("Address.lst")
For Each oItem In Outlook.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
	If oItem.Email1Address&lt;&gt;"" Then
		ts.WriteLine oItem.Email1Address &amp; vbTab &amp; oItem.FullName
	End If
	If oItem.Email2Address&lt;&gt;"" Then
		ts.WriteLine oItem.Email2Address &amp; vbTab &amp; oItem.FullName
	End If
	If oItem.Email3Address&lt;&gt;"" Then
		ts.WriteLine oItem.Email3Address &amp; vbTab &amp; oItem.FullName
	End If
Next
ts.Close
&lt;/pre&gt;
&lt;p&gt;さくっと。他のメーラーにも無論カスタマイズして使ってください。npopqのアドレス帳ほどシンプルなのはたぶんないと思いますがｗ（メールアドレス＜タブ＞名前）&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/152820.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>[VBS] RSS2.0のpubDateを取得する関数</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/07/03/147172.aspx</link><pubDate>Thu, 03 Jul 2008 13:47:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/07/03/147172.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/147172.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/07/03/147172.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/147172.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/147172.aspx</trackback:ping><description>&lt;pre&gt;Function GetPubDate(dDate)
	days = Array("","Sun","Mon","Tue","Wed","Thu","Fri","Sat")
	months = Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	GetPubDate = days(WeekDay(dDate)) &amp; ", " &amp; Right("0" &amp; Day(dDate),2) &amp; " " &amp; months(Month(dDate)) &amp; " " &amp; Year(dDate) &amp; " " &amp; Right("0" &amp; Hour(dDate),2) &amp; ":" &amp;  Right("0" &amp; Minute(dDate),2) &amp; ":" &amp; _
Right("0" &amp; Second(dDate),2) &amp; " +0900"
	'Wed, 05 Oct 2005 19:08:12 +0900
End Function&lt;/pre&gt;

&lt;p&gt;探してもなかったので書いてみました。ついでにRSS1.0のdc:Dateも&lt;/p&gt;
&lt;pre&gt;Function GetDCDate(dDate)
	GetDCDate=Year(dDate) &amp; "-" &amp; Right("0" &amp; Month(dDate),2) &amp; "-" &amp; Right("0" &amp; Day(dDate),2) &amp; "T" &amp; _
	Right("0" &amp; Hour(dDate),2) &amp; ":" &amp;  Right("0" &amp; Minute(dDate),2) &amp; ":" &amp; _
	Right("0" &amp; Second(dDate),2) &amp; "+09:00"
	'2005-10-06T10:31:58+09:00
End Function&lt;/pre&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/147172.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>[Twitter][WSH]Twitterにポストする</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/07/02/146863.aspx</link><pubDate>Wed, 02 Jul 2008 20:48:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/07/02/146863.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/146863.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/07/02/146863.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/146863.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/146863.aspx</trackback:ping><description>&lt;p&gt;Twitterに発言する最も簡単なスクリプトです。twitterPost.vbsと名前を付けて保存してください。&lt;/p&gt; &lt;pre&gt;sUser = "*****" 'ユーザーID
sPassword = "*****" 'パスワード
sURL = "http://twitter.com/statuses/update.json"

Set oHTTP = WScript.CreateObject("Msxml2.XMLHTTP")
Set sc = CreateObject("ScriptControl")
sc.Language = "JScript"
Set js = sc.CodeObject

oHTTP.Open "POST", sURL, False, sUser, sPassword
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.setRequestHeader "X-Twitter-Client", "twitterPost.vbs"
oHTTP.setRequestHeader "X-Twitter-Client-Version", "1.0"
oHTTP.send "status=" &amp; js.encodeURIComponent(WScript.Arguments(0))&lt;/pre&gt;

&lt;p&gt;使い方&lt;/p&gt;
&lt;pre&gt;twitterPost.vbs "テスト投稿"&lt;/pre&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/146863.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>WSH17回</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/05/15/137888.aspx</link><pubDate>Thu, 15 May 2008 20:48:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/05/15/137888.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/137888.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/05/15/137888.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/137888.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/137888.aspx</trackback:ping><description>&lt;p&gt;FileSystemObjectオブジェクトを利用する（2） － ＠IT &lt;a href="http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh17/cformwsh17_01.html"&gt;http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh17/cformwsh17_01.html&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/137888.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>WSH16回公開</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/04/20/133980.aspx</link><pubDate>Sun, 20 Apr 2008 20:33:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/04/20/133980.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/133980.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/04/20/133980.aspx#Feedback</comments><slash:comments>49</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/133980.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/133980.aspx</trackback:ping><description>&lt;p&gt;FileSystemObjectオブジェクトを利用する（1） － ＠IT&lt;br&gt;&lt;a href="http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh16/cformwsh16_01.html"&gt;http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh16/cformwsh16_01.html&lt;/a&gt; &lt;p&gt;FSOですー&lt;/p&gt; &lt;p&gt;私流の切り口で説明しています&lt;br&gt;この説明展開どこかで見かけた方と思った方、するどいです&lt;br&gt;やはり私がFSOやると説明は同じになるんですね&lt;br&gt;私はこれが一番いい分類だと思っています&lt;/p&gt; &lt;p&gt;FSOは3回くらいに分けて解説します。&lt;/p&gt; &lt;p&gt;これが終わったら本連載は終了予定です。&lt;/p&gt; &lt;p&gt;次はー&lt;/p&gt; &lt;p&gt;未定ｗ&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/133980.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>[Gadget補助][WSH]付箋の内容をテキストファイル化</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/03/20/128772.aspx</link><pubDate>Thu, 20 Mar 2008 20:18:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/03/20/128772.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/128772.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/03/20/128772.aspx#Feedback</comments><slash:comments>11</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/128772.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/128772.aspx</trackback:ping><description>&lt;P&gt;Vistaガジェットに「付箋」というのがありますが、その内容をテキストに書き出すスクリプトをWSHで書いてみました。（22:55 WshNetworkを使ってAddDataパスを取得していたのをShell.Application経由で取得に変更）&lt;/P&gt;&lt;PRE&gt;'sTextFolderにVistaガジェット付箋をページごとに0.txt, 1.txt...のように保存していく
sTextFolder = "D:\document\Advanced_es の文書\" 'テキストファイル保存フォルダ
Set Fs = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Const CSIDL_LOCAL_APPDATA  = &amp;H1C
Set tsIni = Fs.OpenTextFile(Fs.BuildPath(objShell.NameSpace(CSIDL_LOCAL_APPDATA).Self.Path, _
            "\Microsoft\Windows Sidebar\Settings.ini"),,,True)
Set regEx = New RegExp
regEx.Global = True
bCNotesSection = False
Do Until tsIni.AtEndOfStream
    sLine = tsIni.ReadLine()
    If InStr(sLine,"CNotes.Gadget") Then
        bCNotesSection = True
    End If
    If bCNotesSection And InStr(sLine,"[") Then
        bCNotesSection = False
    End If
    If bCNotesSection Then
        regEx.Pattern = "(\d+)\=""(.+)"""
        If regEx.Test(sLine) Then
            For Each oMatch In regEx.Execute(sLine)
                Set oSubs = oMatch.SubMatches
                Fs.CreateTextFile(sTextFolder &amp; oSubs(0) &amp; ".txt").Write unescape(oSubs(1))
            Next
        End If
    End If
Loop
tsIni.Close&lt;/PRE&gt;
&lt;P&gt;私はこのスクリプトをタスクスケジューラで5分間隔で動かしています。Advanced esというスマートフォンを使ってますが、これに&lt;A href="http://ades.studio89.jp/?eid=513153"&gt;ViewText&lt;/A&gt;というTodayプラグインを使うとテキストファイルがTodayに表示できるので、同期センターを使うと付箋の内容を同期できるわけです。&lt;/P&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/128772.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>WSH連載15回公開</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/02/21/124306.aspx</link><pubDate>Thu, 21 Feb 2008 18:22:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/02/21/124306.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/124306.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/02/21/124306.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/124306.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/124306.aspx</trackback:ping><description>&lt;p&gt;本業もやってます。 &lt;p&gt;WshNetworkオブジェクトを利用する － ＠IT&lt;br&gt;&lt;a href="http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh15/cformwsh15_01.html"&gt;http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh15/cformwsh15_01.html&lt;/a&gt; &lt;p&gt;あまり目立たないオブジェクトですのでひっそりと一回分で書き上げました。 &lt;p&gt;WSH Remoteについては初心者向けの範囲を逸脱すると編集さんと私の意見が一致したので省略することになりました。なんせ動作させるのにレジストリ操作やコマンドライン操作やDCOMの設定やWindows ファイアウォールの設定などが必要になってくるので動かすまでがたいへん。&lt;a href="http://winscript.s41.xrea.com/wiki/index.php?%5B%5BRemoteWSH%5D%5D"&gt;うちのWiki&lt;/a&gt;などをどうぞ参考になさってください。 &lt;p&gt;なので、次はFileSystemObjectです。WMIやADSIは今回やらないのでいよいよ佳境ですね。&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/124306.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>[記事]最も初心者向けの言語は「Visual Basic」――スクリプト復活へ</title><link>http://blogs.wankuma.com/mutaguchi/archive/2008/02/05/121434.aspx</link><pubDate>Tue, 05 Feb 2008 22:08:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2008/02/05/121434.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/121434.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2008/02/05/121434.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/121434.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/121434.aspx</trackback:ping><description>&lt;p&gt;最も初心者向けの言語は「Visual Basic」――スクリプト復活へ － ＠IT&lt;br&gt;&lt;a href="http://www.atmarkit.co.jp/news/200802/04/vb.html"&gt;http://www.atmarkit.co.jp/news/200802/04/vb.html&lt;/a&gt; &lt;p&gt;わんくまのほかの方も取り上げられていますがメモめも。 &lt;p&gt;VBScript.NETは今のところありませんが、DLR上で動く未来のVBはスクリプト風味になる（orスクリプトとしても使える）ようになるみたいですね。 &lt;p&gt;私はPowerShellと同時にDLRを追っていこうと思っています。やっぱり、お手軽言語があるのはうれしいものです。&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/121434.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>WSH14回</title><link>http://blogs.wankuma.com/mutaguchi/archive/2007/12/28/115293.aspx</link><pubDate>Fri, 28 Dec 2007 15:12:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2007/12/28/115293.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/115293.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2007/12/28/115293.aspx#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/115293.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/115293.aspx</trackback:ping><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;WshShellオブジェクトを利用する（3） － ＠IT&lt;br&gt;&lt;a href="http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh14/cformwsh14_01.html"&gt;http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh14/cformwsh14_01.html&lt;/a&gt; &lt;p&gt;特に問題はない、と思います。&lt;/p&gt; &lt;p&gt;今年はみなさまにたいへんお世話になりました。2008年もどうぞよろしく。&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/115293.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>むたぐち（牟田口大介）</dc:creator><title>WSH連載第13回公開</title><link>http://blogs.wankuma.com/mutaguchi/archive/2007/11/28/110756.aspx</link><pubDate>Wed, 28 Nov 2007 18:11:00 GMT</pubDate><guid>http://blogs.wankuma.com/mutaguchi/archive/2007/11/28/110756.aspx</guid><wfw:comment>http://blogs.wankuma.com/mutaguchi/comments/110756.aspx</wfw:comment><comments>http://blogs.wankuma.com/mutaguchi/archive/2007/11/28/110756.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.wankuma.com/mutaguchi/comments/commentRss/110756.aspx</wfw:commentRss><trackback:ping>http://blogs.wankuma.com/mutaguchi/services/trackbacks/110756.aspx</trackback:ping><description>&lt;p&gt;WshShellオブジェクトを利用する（2） － ＠IT &lt;br&gt;&lt;a href="http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh13/cformwsh13_01.html"&gt;http://www.atmarkit.co.jp/fwin2k/tutor/cformwsh13/cformwsh13_01.html&lt;/a&gt;&lt;br&gt;公開になりましたー &lt;br&gt;今回はレジストリのお話。レジストリの構造の解説が結構占めてます。 &lt;br&gt;WshShellではできなくてよく質問されることも付記しときました。 &lt;br&gt;ネタは・・・ちょこっとｗ &lt;br&gt;だんだん仕込みづらくなってきてます。&lt;/p&gt;&lt;img src ="http://blogs.wankuma.com/mutaguchi/aggbug/110756.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>