日期可以在1.txt里读取,我的 1.txt 是 "20090909" ' (日期格式对吗?)
系统日期等于1.txt时可以打开 e:\ip.bat ,系统日期大于1.txt 时就不能打开e:\ip.bat 了。
求解:系统日期大于1.txt时还能打开e:\ip.bat ?
谢谢... ...- On Error Resume Next
- Set fos = CreateObject("Scripting.FileSystemObject")
- if fos.fileexists("1.txt") then
- Set solFile = fos.openTextFile("1.txt")
- do while solFile.AtEndOfStream <> True
- Dim sProgramme, sRunTime, aTime, iHour, iMinute, oShell
- sProgramme = "e:\ip.bat" '
- sRundate = solfile.readline
- aTime = Split(sRunTime, ":")
- iHour = CInt(aTime(0))
- iMinute = CInt(aTime(1))
- Do While True
- If (Hour(Now) = iHour) And (Minute(Now) = iMinute) Then
- Set oShell = CreateObject("WScript.Shell")
- oShell.Run sProgramme, 1, False
- Set oShell = Nothing
- Exit Do
- End If
- WSH.Sleep 1000
- Loop
- loop
- end if
复制代码
|