Execute script setup and shutdown before windows shutdown blat automatically send email script template
Value: real-time grasp of switch records
Can also be set to remote login to send e-mail, real-time grasp the server remote login situation.
1. Start-- run-- gpedit.msc
two。 Policy-computer configuration-Windows settings-scripting (startup / shutdown)
3. Right-click "shutdown"
4. Add-browse: select script to determine
5. Complete the setup and restart the test.
Note: startup directory of shutdown script: C:\ Windows\ System32\ GroupPolicy\ Machine\ Scripts\ Shutdown\
Set name=%date:~0,4%%date:~5,2%%date:~8,2%
C:\ automail\ close.bat > > C:\ automail\ c%name%.log
Set name=%date:~0,4%%date:~5,2%%date:~8,2%
Set namet=%time:~0,2%%time:~3,2%%time:~6,2%
Rem-email content-
Set body= "% name%%time% your computer is turned off please be aware"
Rem-the subject of the email-
Set s = "% name%%namet% computer shutdown"
Rem-pick-up mailbox
Set t=nn1183@qq.com
Rem-sending mailbox-
Set f=442624872@qq.com
Rem-mailbox key-
Set pw=lxkzgtepiyemcajh
Rem-execute send-
C:\ automail\ Blat.exe-body% body%-s%-t% t%-server smtp.qq.com-f% f%-u% f%-pw% pw%
Study tutorial:
Video tutorial address