- Dim objArgs,wsh,ary,NewDate
- Set objArgs=WScript.Arguments
- If objArgs.Count=0 Then WScript.Quit
- ary=Split(objArgs.Item(0),"-",-1)
- ReDim Preserve ary(1)
- Call SetDateAdd(NewDate,ary(0),ary(1))
- SetClipboardText(NewDate)
- Set wsh=CreateObject("WScript.Shell")
- WScript.Sleep 100
- wsh.SendKeys "^v"
- Set wsh=Nothing
- Sub SetClipboardText(Text) '写入信息到剪切板
- CreateObject("WScript.Shell").Run _
- "mshta vbscript:ClipboardData.SetData(""text""," & _
- Chr(34)& Text &Chr(34)& ")(close)",0,True
- End Sub
- Sub SetDateAdd(NewDate,strDay,strNum)
- If IsEmpty(strNum) Then strNum=1
- Select Case LCase(strDay)
- Case "zt"
- NewDate=DateAdd("d",-strNum,Date)
- Case "mt"
- NewDate=DateAdd("d",strNum,Date)
- Case Else
- WScript.Quit
- End Select
- End Sub
复制代码
[ 本帖最后由 broly 于 2011-1-25 15:52 编辑 ] |