Created
December 7, 2018 10:24
-
-
Save robsonpiere/b2f317ed15a78397fce0a6d6b82152c8 to your computer and use it in GitHub Desktop.
Scripts Utéis para Windows Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Echo Off | |
Set ServiceName=MySQL57 | |
SC queryex "%ServiceName%"|Find "STATE"|Find /v "RUNNING">Nul&&( | |
echo %ServiceName% Fora do AR | |
echo Start %ServiceName% | |
Net start "%ServiceName%">nul||( | |
Echo "%ServiceName%" não pode ser iniciado | |
exit /b 1 | |
) | |
echo %date%-%time% - "%ServiceName%" iniciado com sucesso >> "verifica_servico_%ServiceName%.log" | |
blat -to "[email protected], [email protected]" -server stmp.x.com -f [email protected] -subject "Tarefa executada no servidor" -body "%ServiceName% iniciado" | |
exit /b 0 | |
)||( | |
echo "%ServiceName%" no ar | |
exit /b 0 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download Blat : http://www.blat.net