`

tomcat启动脚本

阅读更多
on   error   resume   Next     

Dim   a   ,sRunTime,aTime,iHour,iMinute ,iReturn
a   =   True    

sRunTime = "16:24" 
aTime = Split(sRunTime, ":")
iHour = CInt(aTime(0))
iMinute = CInt(aTime(1))

data="restart tomcat6------------>"
    
set   WshShell   =   WScript.CreateObject("WScript.Shell") 

set fs =createobject("scripting.filesystemobject")
    
Do   While   a     
set   http   =   CreateObject("Microsoft.XMLHTTP")     
http.open   "GET","http://localhost:8080/test",false 
http.send     
 set ts =fs.opentextfile("c:\11.txt",8,true)
if   http.Status   >   299   then      
    iReturn=WshShell.Run("cmd.exe /C g:\Developer\Application\tomcat6.0\bin\shutdown.bat", 0, TRUE)
    WScript.Sleep(30000)
   iReturn= WshShell.Run("cmd.exe /C g:\Developer\Application\tomcat6.0\bin\startup.bat", 0, TRUE)
    ts.write data
    ts.write "error code:"
    ts.write http.Status
    ts.write "-------error time:"
    ts.write Now
    ts.writeblanklines 2
    ts.close
Else
If (Hour(Now) = iHour) And (Minute(Now) = iMinute) Then
   iReturn=WshShell.Run("cmd.exe /C g:\Developer\Application\tomcat6.0\bin\shutdown.bat", 0, TRUE)
    WScript.Sleep(30000)
   iReturn= WshShell.Run("cmd.exe /C g:\Developer\Application\tomcat6.0\bin\startup.bat", 0, TRUE)
ts.write "dingshi-start" 
ts.write "-------error time:"
ts.write now
ts.writeblanklines 2
ts.close
End If
end   if     
WScript.Sleep(40000) 
loop
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics