VBScript: DailyMemo
Posted at 2004-03-25T09:49:00+09:00 in Coding
ダブルクリックするとその日の日付けを元にしたファイル名で既定フォルダ(My Documents)にテキストファイルを作り(既存の場合は何もしない)、関連付けに従って開くVBScriptをでっち上げてみる。ToDoメモなんかに使うんだろう、多分。
Dim yy, mm, dd, today
yy = CStr(Year(Now))
yy = Right(yy, 2)
mm = "0" + CStr(Month(Now))
mm = Right(mm, 2)
dd = "0" + CStr(Day(Now))
dd = Right(dd, 2)
today = yy + "-" + mm + "-" + dd
Dim WshShell, FileSys, f
Set WshShell = WScript.CreateObject("WScript.Shell")
Set FileSys = CreateObject("Scripting.FileSystemObject")
f = WshShell.SpecialFolders("MyDocuments") + "\\" + today + ".txt"
If (FileSys.FileExists(f)) Then
WshShell.Run(f)
Else
FileSys.CreateTextFile(f)
WshShell.Run(f)
End If
Set FileSys = Nothing
Set WshShell = Nothing
WScript.Quit
暇つぶし。VBScriptにsprintf欲しいな。
Weblog archives
by Month
- October, 2006 (9)
- September, 2006 (23)
- August, 2006 (31)
- July, 2006 (8)
- October, 2005 (13)
- September, 2005 (24)
- August, 2005 (26)
- July, 2005 (2)
- June, 2005 (2)
- May, 2005 (13)
- April, 2005 (30)
- March, 2005 (33)
- February, 2005 (13)
- January, 2005 (10)
- December, 2004 (28)
- November, 2004 (27)
- October, 2004 (25)
- September, 2004 (38)
- August, 2004 (52)
- July, 2004 (45)
- June, 2004 (41)
- May, 2004 (48)
- April, 2004 (36)
- March, 2004 (51)
- February, 2004 (55)
- January, 2004 (63)
- December, 2003 (46)
- November, 2003 (63)
- October, 2003 (92)
- September, 2003 (61)
- August, 2003 (93)
- July, 2003 (57)
- May, 2003 (5)
- April, 2003 (35)
- March, 2003 (35)
- February, 2003 (37)
- January, 2003 (62)
- December, 2002 (32)
This page was last modified on 2004-03-25T09:49:49+09:00 (in 0.148 secs).