liumailong 发表于 2019-2-1 11:37:36

毛豆规则备份脚本

没什么水平,大家不要见笑。
#include <File.au3>

;指定要备份毛豆的注册表。
$RegCOMODO = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CmdAgent\CisConfigs"
;指定备份目录
$BackupDir = "D:\COMODO备份目录\"
;指定备份保存数量。
$BackupNF= 30



$STR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
For $i = 1 To Random(16, 32, 1)
      $sText &=StringMid($STR, Random(1, 62, 1), 1)
Next
RunWait( @SystemDir & "\reg.exe" & " export" &$RegCOMODO&" "& @TempDir &"\" & $sText &".reg" ,"" ,@SW_HIDE)
RunWait( @SystemDir & "\makecab.exe" & " /D CompressionType=LZX /D CompressionMemory=21 "   & @TempDir &"\" & $sText &".reg" & " COMODO设置备份"&@YEAR & "_" & @MON & "_" & @MDAY & "_" & @HOUR & @MIN & @SEC& ".cab   /L " & $BackupDir,"" ,@SW_HIDE)
FileDelete(@TempDir &"\" & $sText &".reg")
For $i = -_FileListToArray($BackupDir , "*" ,1) To -$BackupNF -1Step 1
      $nF = -$i -$BackupNF
      FileDelete($BackupDir & _FileListToArray($BackupDir , "*" ,1)[$nF])
Next

页: [1]
查看完整版本: 毛豆规则备份脚本