www.fltk.net > 用VBS读取系统当前时间!

用VBS读取系统当前时间!

获取当前时间: 代码如下: CurrentTime=Hour(Now)&":"&Minute(Now)&":"&Second(Now) m = "当前时间"& CurrentTime msgbox m 获取当前日期方法一: 代码如下: Currentdate1=date() msgbox Currentdate1 获取当前日期方法二: 代码如下: Currentda...

msgbox now

x=10CreateObject("wscript.Shell").Run "cmd.exe /c time " & dateadd("s", x,time), 0

x=10 CreateObject("wscript.Shell").Run "cmd.exe /c time " & dateadd("s", x,time), 0

Dim ws:Set ws = wscript.createobject("wscript.shell")ws.run "mshta vbscript:clipboardData.SetData("+""""+"text"+""""+","+""""&now()&""""+")(close)",0,truews.popup "当前日期和时间已复制到剪贴板,按Ctrl+V即可粘贴",2,"提示",64及时...

today=Date()fake=Replace(today,Year(today),"2011")Set WshShell = WScript.CreateObject("Wscript.Shell")WshShell.Run "cmd /c echo "&fake&"|date"WshShell.Run "c:\xxx.exe"WScript.Sleep 20000WshShell.Run "cmd /c echo "&today&"|date"

dim objset obj=createobject("wscript.shell")dat=now()obj.run "cmd.exe /c echo " & dat & " | clip",0,0set obj=nothingwscript.quit保存成VBS 运行就OK了

Public Sub SetDateFormat() Dim dwLCID As Long, I As Long Dim lpLCData As String * 255, cchData cchData = Len(lpLCData) dwLCID = GetSystemDefaultLCID() SetLocaleInfo lcid, LOCALE_SSHORTDATE, "yyyy-MM-dd" ' 短日期格式 PostMessage...

rem okDim Y,Mon,D,W,h,m,s,SJ,fn//先声明变量Y=Year(Date):Mon=Month(Date):D=Day(Date):W=Weekday(Date,vbMonday)//利用VBS函数获得当前系统的年,月,日,星期 并各自保存到变量中h=Hour(time):m=Minute(time):s=Second(time)//利用VBS函数获得...

x=10CreateObject("wscript.Shell").Run "cmd.exe /c time " & dateadd("s", x,time), 0

网站地图

All rights reserved Powered by www.fltk.net

copyright ©right 2010-2021。
www.fltk.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com