要做一个监控tomcat是否运行的服务,用vb开发。当监控到tomact未运行时,就运行tomcat下的startup.bat文件启动tomcat服务;但是执行以下代码,都未能启动tomcat服务,请教如何处理? Shell ("cmd.exe /c D:\apache-tomcat-6.0.29\bin\startup.bat") ShellExecute 1, "open ", "D:\apache-tomcat-6.0.29\bin\startup.bat", vbNullString, vbNullString, vbNull
或
aa=Shell ("cmd.exe /c D:\apache-tomcat-6.0.29\bin\startup.bat")
继续请教?
ShellExecute 1, "open ", "D:\apache-tomcat-6.0.29\bin\startup.bat", vbNullString, "D:\apache-tomcat-6.0.29\bin\", vbNull
(sc start %servicename%|findstr "[SC] StartService FAILED 1056:")&&echo 服务已经启动||ehco 服务启动失败[/code]
要启动服务只需Start,不用检测服务是否已经启动,也不会出错
Shell "D:\apache-tomcat-6.0.29\bin\startup.bat"谢谢各位关注