Get the App
SLTechnology News&Howtos  ›  Servers  › 

Execute script setup and shutdown before windows shutdown blat automatically send email script template

Shulou Source: shulou.com Published: 2022-06-02 11:19:41 10月03日 Update

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

Tags: Scripts email mailboxes real-time tutorials computers logins topics values content addresses learning tutorials situations servers directories policies videos computers learning services Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info Huawei Shulou Information MariaDB