Sorry, I must be missing something. Why you cannot run it as is in your "environment?" Please explain what you mean by "my environment." Do you have 24x7 Scheduler installed on your system? Do you know that this is JAL (Job Automation Language Script) which can be run by the 24x7 Scheduler as a script type job? : Actually, here is the script below.... : ServiceGetStatus "MSSQLServer" : // verify that the service is running or starting : Dim status, string : Dim running, boolean : ServiceGetStatus "MSSQLServer", status : IsEqual status, "RUNNING", running : IfThen running, DONE : IsEqual status, ""START PENDING", running : IfThen running, DONE : START_SERVICE: ServiceStart "MSSQLServer" : // verify that the service is running or starting : ServiceGetStatus "MSSQLServer", status : IsEqual status, "RUNNING", running : If running, NOTIFY_OK, NOTIFY_FAIL : NOTIFY_OK: MailSend "SMTP", "myname", : "myspassword", "sysadmin@mycompany", & : "SQL-Server Restarted", "24x7 Scheduler detected that : SQL-Server was not running and successfully restarted it" : exit : NOTIFY_FAIL: MailSend "SMTP", "myname", : "myspassword", "sysadmin@mycompany", & : "SQL-Server Restart Failed", "24x7 Scheduler detected that : SQL-Server was not running, but was not able to restart it" : DONE: // Done : Exit
|