vb:
appPoolName = WScript.Arguments(0) Set oWebAdmin = GetObject("winmgmts:root\WebAdministration") Set oAppPool = oWebAdmin.Get("ApplicationPool.Name=‘" + appPoolName + "‘") oAppPool.Recycle set fso=createobject("scripting.filesystemobject") if (fso.fileexists("C:\WebRoot\WebSite\FLFTask\Logs\recycleIISPool.log")) then ‘1-forreading,2-forwriting,8-appending set file=fso.opentextfile("C:\WebRoot\WebSite\FLFTask\Logs\recycleIISPool.log",8,ture) else set file=fso.createtextfile( "C:\WebRoot\WebSite\FLFTask\Logs\recycleIISPool.log",8,ture) end if ‘write(x)写入x个字符,writeline写入换行,writeblanklines(n)写入N个空行 file.writeline now&" 应用程序池“"&appPoolName &"”已经回收成功。" file.close
并写bat
cscript recyclepool.vbs EduWebApi
并放入任务计划程序中 执行Bat