tomcat window版本自动重启脚本

 on   error   resume   Next      
     Dim   a    
     a   =   True    
     
     set   WshShell   =   WScript.CreateObject("WScript.Shell")    
   
     Do   While   a    
     set   http   =   CreateObject("Microsoft.XMLHTTP")    
     http.open   "get","项目地址",false    
     http.send    
     if   http.Status   >   300   then    
           WshShell.Run "cmd /c shutdown.bat",3   
           WScript.Sleep(10000)    
		   set fso=CreateObject("scripting.filesystemobject")
			on error resume next
			set sfold=fso.getfolder("删除项目地址")
			sfold.attributes=0
			sfold.delete
			if err then msgbox "can't find fold"
           WshShell.Run "cmd /c startup.bat",3       
     end   if    
     WScript.Sleep(30000)    
     loop

直接放到tomcat bin目录执行

停止脚本,打开任务管理器,将“wscript.exe”结束掉即可。

猜你喜欢

转载自my.oschina.net/u/586536/blog/915301