展开全部
偶是新手,只会笨办法,请高手指点~----------用下面的脚本可以实现
========代码开始========
set wshshell = CreateObject("WScript.Shell")
set fs = CreateObject("Scripting.FileSystemObject")
str=InputBox("请输入你要更改的日期!格式为""&vbCr&"Year-MM-DD;HH:MM:SS.SS")
if str="" or str=vbCancel then WScript.Quit
str=split(str,";")
if str(0)<>vbCancel then
answerfile="C:\temp.txt"
set answers=fs.CreateTextFile(answerfile,true)
answers.WriteLine str(0)
answers.close
command="%COMSPEC% /c date <"&answerfile
result=wshshell.Run(command,0,true)
end if
if UBound(str)=1 then
if str(1)<>vbCancel then
set answers=fs.CreateTextFile(answerfile,true)
answers.WriteLine str(1)
answers.close
command="%COMSPEC% /c time <"&answerfile
result=wshshell.Run(command,0,true)
end if
end if
command="%COMSPEC% /c del c:\temp.txt"
result=wshshell.Run(command,0,true)
==========代码结束===========
========代码开始========
set wshshell = CreateObject("WScript.Shell")
set fs = CreateObject("Scripting.FileSystemObject")
str=InputBox("请输入你要更改的日期!格式为""&vbCr&"Year-MM-DD;HH:MM:SS.SS")
if str="" or str=vbCancel then WScript.Quit
str=split(str,";")
if str(0)<>vbCancel then
answerfile="C:\temp.txt"
set answers=fs.CreateTextFile(answerfile,true)
answers.WriteLine str(0)
answers.close
command="%COMSPEC% /c date <"&answerfile
result=wshshell.Run(command,0,true)
end if
if UBound(str)=1 then
if str(1)<>vbCancel then
set answers=fs.CreateTextFile(answerfile,true)
answers.WriteLine str(1)
answers.close
command="%COMSPEC% /c time <"&answerfile
result=wshshell.Run(command,0,true)
end if
end if
command="%COMSPEC% /c del c:\temp.txt"
result=wshshell.Run(command,0,true)
==========代码结束===========
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询