• 去除桌面快捷方式小箭头
::方法一:
::Win + R
cmd /k reg delete "HKEY_CLASSES_ROOT\lnkfile" /v IsShortcut /f & taskkill /f /im explorer.exe & start explorer.exe
::方法二:
::新建bat文件,然后将下面的代码拷贝进去保存,然后执行bat文件
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d "%systemroot%\system32\imageres.dll,197" /t reg_sz /f
taskkill /f /im explorer.exe
attrib -s -r -h "%userprofile%\AppData\Local\iconcache.db"
del "%userprofile%\AppData\Local\iconcache.db" /f /q
start explorer
pause
  • 去除QQ聊天窗口的广告
@echo off
rd C:\Users\%username%\AppData\Roaming\Tencent\QQ\Misc\com.tencent.advertisement /s /q
del C:\Users\%username%\AppData\Roaming\Tencent\QQ\Misc\com.tencent.advertisement
type nul>C:\Users\%username%\AppData\Roaming\Tencent\QQ\Misc\com.tencent.advertisement
  • 启动和关闭入站规则
netsh advfirewall firewall set rule "SQL Ports" new enable = yes
netsh advfirewall firewall set rule "SQL Ports" new enable = no
  • 清理系统垃圾
@echo off
@echo 正在清理系统垃圾文件,请稍等......
@del /f /s /q %systemdrive%\*.tmp
@del /f /s /q %systemdrive%\*._mp
@del /f /s /q %systemdrive%\*.log
@del /f /s /q %systemdrive%\*.gid
@del /f /s /q %systemdrive%\*.chk
@del /f /s /q %systemdrive%\*.old
@del /f /s /q %systemdrive%\recycled\*.*
@del /f /s /q %windir%\*.bak
@del /f /s /q %windir%\prefetch\*.*
@rd /s /q %windir%\temp & md %windir%\temp
@del /f /q %userprofile%\cookies\*.*
@del /f /q %userprofile%\recent\*.*
@del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
@del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
@del /f /s /q "%userprofile%\recent\*.*"
@echo 清理系统垃圾完成!
@exit
  • 远程重启服务器脚本
net use \\远程机器IP\ipc$ "密码" /user:"administrator"
shutdown -r -f -t 1 -m \\远程机器IP

用法: shutdown [ -l | -s | -r ] [-f] [-m \computername] [-t xx]
-l 注销(不能与选项 -m 一起使用)
-s 关闭此计算机
-r 关闭并重启动此计算机
-f 强制运行的应用程序关闭而没有警告
-m \computername 远程计算机关机/重启动/放弃
-t xx 设置关闭的超时为 xx 秒

例如:

@ net use \\192.168.18.123\ipc$ "123456" /user:"administrator"
@ shutdown -r -f -m \\192.168.18.123 -t 1
  • 重启服务脚本
@echo off
echo 即将重启“Service Name”服务

net stop "Service Name"
net stop "Service Name"

@echo off
ping -n 2 127.1>nul
for /l %%i in (9,-1,1) do (
set/p=%%i秒后自动关闭<nul
  ping 127.1 -n 2 >nul
)
echo.&echo.
exit
  • 如果以当前日期为名称的文件夹不存在,则创建并打开该文件夹
@echo off
set foldername=%date:~0,4%%date:~5,2%%date:~8,2%
if not exist %foldername% mkdir %foldername%\publish & mkdir %foldername%\bakup
start %foldername%\publish & start %foldername%\bakup
  • 监测邮箱服务是否正常,不正常则重启邮箱服务
@echo off
::Make Environment Empty.
if exist %cd%\send.txt del -rf %cd%\send.txt
if exist %cd%\receive.txt del -rf %cd%\receive.txt

::Please Replace The domain.com With Your domain Or IP
start telnet.exe domain.com 25 -f %cd%\send.txt && ping 127.0.0.1 -n 3 >nul && taskkill -f -im telnet.exe
start telnet.exe domain.com 110 -f %cd%\receive.txt && ping 127.0.0.1 -n 3 >nul && taskkill -f -im telnet.exe

find "220 Appkiz SMTP Server Ready." send.txt && find "+OK Appkiz POP3 Server is Ready" receive.txt && goto clearFiles

::Restart Email Service.
net stop "Appkiz EmailServer"
net start "Appkiz EmailServer"

::Clear .txt Files We Created.
:clearFiles
del -rf %cd%\send.txt
del -rf %cd%\receive.txt

这里需要配合系统的计划任务使用,定时检测。

更新时间:2017年9月15日15:32:36;持续更新中···


Ably
603 声望44 粉丝

Let everything around us become better


引用和评论

0 条评论