编译过程中出现的错误
本帖最后由 lin0308 于 2009-8-22 12:43 编辑#NoTrayIcon
#include <GUIConstants.au3>
#Include <GuiStatusBar.au3>
#include <ChangeScreenRes.au3>
#include <Array.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $wbemFlagReturnImmediately = 0x10
Global $wbemFlagForwardOnly = 0x20
Global $strComputer = "localhost"
Global $colItems = ""
Local $a_PartsRightEdge =
Local $a_PartsText = [" "]
$gui = GUICreate("系统快速设置工具", 400, 300)
_GUICtrlStatusBar_Create($gui, $a_PartsRightEdge, $a_PartsText)
FileInstall("set.jpg", @SystemDir & "\")
GUICtrlCreatePic(@SystemDir& "\set.jpg", 0, 0, 0, 0)
FileDelete(@SystemDir& "\set.jpg")
$tab = GUICtrlCreateTab(1, 100, 400, 1080)
$tab0 = GUICtrlCreateTabItem("分辨率")
GUICtrlCreateGroup("分辨率设置", 20, 130, 360, 130)
GUICtrlCreateGroup("CRT显示器", 30, 150, 80, 80)
GUICtrlCreateGroup("液晶显示器", 120, 150, 80, 80)
GUICtrlCreateGroup("宽屏液晶", 210, 150, 80, 80)
$tab0radio1 = GUICtrlCreateRadio("800*600", 35, 165)
$tab0radio2 = GUICtrlCreateRadio("1024*768", 35, 185)
$tab0radio3 = GUICtrlCreateRadio("1280*1024", 35, 205)
$tab0radio4 = GUICtrlCreateRadio("15寸 LCD", 130, 165)
$tab0radio5 = GUICtrlCreateRadio("17寸 LCD", 130, 185)
$tab0radio6 = GUICtrlCreateRadio("19寸 LCD", 130, 205)
$tab0radio7 = GUICtrlCreateRadio("17寸宽屏", 220, 165)
$tab0radio8 = GUICtrlCreateRadio("19寸宽屏", 220, 185)
$tab0radio9 = GUICtrlCreateRadio("22寸宽屏", 220, 205)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateLabel("分辨率设置过可能高造成黑屏,按下CTRL+R可快速降低分辨率", 50, 240)
GUICtrlSetColor(-1, 0xff0000)
$tab0button = GUICtrlCreateButton("设 置", 305, 180, 60, 25)
HotKeySet("^r", "DefaultRes")
$tab1 = GUICtrlCreateTabItem("共享设置")
GUICtrlCreateGroup("设置局域网共享", 20, 130, 360, 130)
$tab1radio1 = GUICtrlCreateRadio("开通局域网共享(访问本机不需密码)", 50, 160)
$tab1radio2 = GUICtrlCreateRadio("开通局域网共享(默认密码:123456)", 50, 185)
$tab1radio3 = GUICtrlCreateRadio("关闭局域网共享", 50, 210)
$tab1button = GUICtrlCreateButton("设 置", 305, 220, 60, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$tab2 = GUICtrlCreateTabItem("登陆设置")
$username = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName")
GUICtrlCreateGroup("用户自动登陆", 20, 130, 360, 130)
GUICtrlCreateLabel("用户名:", 100, 155)
$tab2input1 = GUICtrlCreateInput("", 150, 150, 115, 20)
$tab2input1data = GUICtrlSetData($tab2input1, $username)
GUICtrlCreateLabel("密 码:", 100, 180)
$tab2input2 = GUICtrlCreateInput("", 150, 175, 115, 20, $ES_PASSWORD)
$tab2button1 = GUICtrlCreateButton("设置自动登陆", 90, 210)
$tab2button2 = GUICtrlCreateButton("取消自动登陆", 210, 210)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$tab3 = GUICtrlCreateTabItem("IP设置")
GUICtrlCreateGroup("网络地址", 20, 130, 360, 130)
GUICtrlCreateLabel("IP 地 址:", 30, 150)
$tab3input1 = GUICtrlCreateInput("192.168.1.8", 90, 148, 100, 15)
GUICtrlCreateLabel("子网掩码:", 30, 170)
$tab3input2 = GUICtrlCreateInput("255.255.255.0", 90, 168, 100, 15)
GUICtrlCreateLabel("默认网关:", 30, 190)
$tab3input3 = GUICtrlCreateInput("192.168.1.1", 90, 188, 100, 15)
GUICtrlCreateLabel("首选 DNS:", 30, 210)
$tab3input4 = GUICtrlCreateInput("202.98.96.68", 90, 208, 100, 15)
GUICtrlSetState($tab3input4, $GUI_DISABLE)
GUICtrlCreateLabel("备用 DNS:", 30, 230)
$tab3input5 = GUICtrlCreateInput("61.139.2.69", 90, 228, 100, 15)
GUICtrlSetState($tab3input5, $GUI_DISABLE)
$tab3check1 = GUICtrlCreateCheckbox("启用本地DNS", 238, 150)
$tab3button1 = GUICtrlCreateButton("自动获取IP和DNS", 230, 180, 100, 25)
$tab3button2 = GUICtrlCreateButton("设 置", 230, 220, 100, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$tab4 = GUICtrlCreateTabItem("磁盘格式")
GUICtrlCreateGroup("磁盘格式", 20, 130, 360, 100)
GUICtrlCreateLabel("NTFS格式是WinXp推荐使用的格式,具有文件加密,远程存储,", 40, 150)
GUICtrlCreateLabel("磁盘配额,恢复磁盘活动的日志记录,对单个文件而不仅仅对", 40, 170)
GUICtrlCreateLabel("文件夹设置权限等优点,但因DOS/WIN9X均不能识别,初级用户", 40, 190)
GUICtrlCreateLabel("不建议转换.", 40, 210)
GUICtrlCreateLabel("请选择要转换的分区:", 40, 245)
$tab4button = GUICtrlCreateButton("转换", 280, 238, 60, 25)
$tab4combo1 = GUICtrlCreateCombo("", 180, 240, 50, 30)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$disk = DriveGetDrive("FIXED")
If Not @error Then
For $i = 1 To $disk
GUICtrlSetData($tab4combo1, $disk[$i], $disk)
Next
EndIf
$tab5 = GUICtrlCreateTabItem("其它设置")
GUICtrlCreateGroup("清理系统垃圾", 20, 130, 360, 130)
$tab5check1 = GUICtrlCreateCheckbox("垃圾文件、临时文件", 40, 150)
$tab5check2 = GUICtrlCreateCheckbox("多余的桌面右键菜单", 200, 150)
$tab5check3 = GUICtrlCreateCheckbox("修复OE6不能保存密码", 40, 170)
$tab5check4 = GUICtrlCreateCheckbox("清除autorun.inf及病毒", 200, 170)
$tab5check5 = GUICtrlCreateCheckbox("免疫autorun.inf", 40, 190)
$tab5check6 = GUICtrlCreateCheckbox("程序,安全性,系统日志", 200, 190)
$tab5button1 = GUICtrlCreateButton("开启小键盘", 40, 220, 85, 25)
$tab5button2 = GUICtrlCreateButton("关闭小键盘", 150, 220, 85, 25)
$tab5button3 = GUICtrlCreateButton("清理系统垃圾", 260, 220, 85, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$tab6 = GUICtrlCreateTabItem("打印机")
GUICtrlCreateGroup("打印机", 20, 130, 360, 130)
GUICtrlCreateLabel("HP3XXX系列USB接口打印机,清除打印作务要等很久才能清除,", 40, 150)
GUICtrlCreateLabel("甚至重启计算机才能清除,你可以使用下面的选项来快速清", 40, 170)
GUICtrlCreateLabel("除打印任务。", 40, 190)
$tab6button1 = GUICtrlCreateButton("清除打印任务", 40, 220, 85, 25)
$tab6button2 = GUICtrlCreateButton("开启打印服务", 150, 220, 85, 25)
$tab6button3 = GUICtrlCreateButton("关闭打印服务", 260, 220, 85, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg=$tab0button
_res()
Case $msg=$tab1button
_lanshare()
Case $msg = $tab2button1
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 1)
$password = GUICtrlRead($tab2input2)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", $password)
MsgBox(0, "系统快速设置工具", "设置成功,重启计算机生效", 2)
Case $msg = $tab2button2
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 0)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", "")
MsgBox(0, "系统快速设置工具", "已取消自动登陆,重启计算机生效", 2)
Case $msg = $tab3check1 And BitAND(GUICtrlRead($tab3check1), $GUI_CHECKED) = $GUI_CHECKED
GUICtrlSetState($tab3input4, $GUI_ENABLE)
GUICtrlSetState($tab3input5, $GUI_ENABLE)
Case $msg = $tab3check1 And BitAND(GUICtrlRead($tab3check1), $GUI_UNCHECKED) = $GUI_UNCHECKED
GUICtrlSetState($tab3input4, $GUI_DISABLE)
GUICtrlSetState($tab3input5, $GUI_DISABLE)
Case $msg = $tab3button1
GUICtrlSetState($tab3button1, $GUI_DISABLE)
GUICtrlSetState($tab3button2, $GUI_DISABLE)
RunWait(@ComSpec & ' /c netsh interface ip set dns name="本地连接" source=dhcp', '', @SW_HIDE);设置自动获取DNS
RunWait(@ComSpec & ' /c netsh interface ip set address name="本地连接" source=dhcp', '', @SW_HIDE);设置自动获取IP
MsgBox(0, "系统快速设置工具", "设置完成")
GUICtrlSetState($tab3button1, $GUI_ENABLE)
GUICtrlSetState($tab3button2, $GUI_ENABLE)
Case $msg = $tab3button2
GUICtrlSetState($tab3button2, $GUI_DISABLE)
If GUICtrlRead($tab3check1) = $GUI_CHECKED Then
$tab3input4data = GUICtrlRead($tab3input4)
$tab3input5data = GUICtrlRead($tab3input5)
_DNS($tab3input4data, $tab3input5data)
EndIf
$tab3input1data = GUICtrlRead($tab3input1)
$tab3input2data = GUICtrlRead($tab3input2)
$tab3input3data = GUICtrlRead($tab3input3)
_SetIpAddress($tab3input1data, $tab3input2data, $tab3input3data)
MsgBox(0, "系统快速设置工具", "网络设置成功")
GUICtrlSetState($tab3button2, $GUI_ENABLE)
Case $msg = $tab4button
$drive = GUICtrlRead($tab4combo1)
If DriveGetFileSystem($drive) = "NTFS" Then
MsgBox(0, "系统快速设置工具", "此分区已是NTFS格式无需转换")
ContinueLoop
Else
RunWait(@ComSpec & ' /c convert ' & $drive & ' /fs:ntfs', '')
EndIf
Case $msg = $tab5button1
RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Keyboard", "InitialKeyboardIndicators", "REG_SZ", 0)
Send("{NumLock on}")
MsgBox(0,"系统快速设置工具","重启后小键盘处于开启状态",3)
Case $msg = $tab5button2
RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Keyboard", "InitialKeyboardIndicators", "REG_SZ", 2)
Send("{NumLock off}")
MsgBox(0,"系统快速设置工具","重启后小键盘处于关闭状态",3)
Case $msg = $tab5button3
GUICtrlSetState($tab5button3,$GUI_DISABLE)
If GUICtrlRead($tab5check1) = $GUI_CHECKED Then
ToolTip("正在清理系统垃圾,请稍候....", @DesktopWidth - 200, @DesktopHeight - 80, "", 0, 1)
_CleanLJ()
EndIf
If GUICtrlRead($tab5check2) = $GUI_CHECKED Then ;多余的桌面右键菜单,网上批处理改写
ToolTip("正在清理多余的桌面右键菜单,请稍候....", @DesktopWidth - 230, @DesktopHeight - 80, "", 0, 1)
RunWait(@ComSpec & ' /c regsvr32 /u /s igfxpph.dll', '', @SW_HIDE)
RunWait(@ComSpec & ' /c reg delete HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers /f', '', @SW_HIDE)
RegWrite("HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\new", "", "REG_SZ", "{D969A300-E7FF-11d0-A93B-00A0C90F2719}")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "HotKeysCmds")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "IgfxTray")
EndIf
If GUICtrlRead($tab5check3) = $GUI_CHECKED Then ;修复OE6不能保存密码,手动封装或SRS9.7以下封装的xp可能需要
ToolTip("正在修复OE6不能保存密码,请稍候....", @DesktopWidth - 200, @DesktopHeight - 80, "", 0, 1)
_FixOE()
EndIf
If GUICtrlRead($tab5check4) = $GUI_CHECKED Then;清除autorun.inf及病毒
_KillOthers()
_KillSxS()
EndIf
If GUICtrlRead($tab5check5) = $GUI_CHECKED Then;免疫autorun.inf
ToolTip("正在免疫autorun.inf,请稍候....", @DesktopWidth - 200, @DesktopHeight - 80, "", 0, 1)
_MDdir()
EndIf
If GUICtrlRead($tab5check6) = $GUI_CHECKED Then;程序,安全性,系统日志
ToolTip("正在清理 程序,安全性,系统日志,请稍候....", @DesktopWidth - 230, @DesktopHeight - 80, "", 0, 1)
_CleanEvent()
EndIf
ToolTip("")
MsgBox(0,"系统快速设置工具","清理完成",3)
GUICtrlSetState($tab5button3,$GUI_ENABLE)
Case $msg = $tab6button1
GUICtrlSetState($tab6button1, $GUI_DISABLE)
If ProcessExists("SPOOLSV.EXE") Then
RunWait(@ComSpec & " /c net stop spooler", "", @SW_HIDE)
ProcessWaitClose("SPOOLSV.EXE")
EndIf
FileDelete(@SystemDir & "\spool\PRINTERS\*.*")
If Not ProcessExists("spoolsv.exe") Then
RunWait(@ComSpec & ' /c sc config spooler start= "AUTO"', '', @SW_HIDE)
RunWait(@ComSpec & ' /c net start spooler', '', @SW_HIDE)
EndIf
MsgBox(0, "系统快速设置工具", "打印任务清除成功!", 2)
GUICtrlSetState($tab6button1, $GUI_ENABLE)
Case $msg = $tab6button2
GUICtrlSetState($tab6button2, $GUI_DISABLE)
RunWait(@ComSpec & ' /c sc config spooler start= "AUTO"', '', @SW_HIDE)
RunWait(@ComSpec & ' /c net start spooler', '', @SW_HIDE)
If ProcessExists("SPOOLSV.EXE") Then
MsgBox(0, "系统快速设置工具", "打印服务开启成功", 2)
EndIf
GUICtrlSetState($tab6button2, $GUI_ENABLE)
Case $msg = $tab6button3
GUICtrlSetState($tab6button3, $GUI_DISABLE)
RunWait(@ComSpec & ' /c sc config spooler start= "DISABLED"', '', @SW_HIDE)
RunWait(@ComSpec & ' /c net stop spooler', '', @SW_HIDE)
ProcessWaitClose("SPOOLSV.EXE")
If Not ProcessExists("SPOOLSV.EXE") Then
MsgBox(0, "系统快速设置工具", "打印服务关闭成功", 2)
EndIf
GUICtrlSetState($tab6button3, $GUI_ENABLE)
EndSelect
WEnd
Func _res()
If GUICtrlRead($tab0radio1) = $GUI_CHECKED Then
_ChangeScreenRes (800, 600, 32, 85)
EndIf
If GUICtrlRead($tab0radio2) = $GUI_CHECKED Then
_ChangeScreenRes (1024, 768, 32, 85)
EndIf
If GUICtrlRead($tab0radio3) = $GUI_CHECKED Then
_ChangeScreenRes (1280, 1024, 32, 85)
EndIf
If GUICtrlRead($tab0radio4) = $GUI_CHECKED Then
_ChangeScreenRes (1024, 768, 32, 60)
EndIf
If GUICtrlRead($tab0radio5) = $GUI_CHECKED Then
_ChangeScreenRes (1024, 768, 32, 60)
EndIf
If GUICtrlRead($tab0radio6) = $GUI_CHECKED Then
_ChangeScreenRes (1280, 1024, 32, 60)
EndIf
If GUICtrlRead($tab0radio7) = $GUI_CHECKED Then
_ChangeScreenRes (1280, 720, 32, 60)
EndIf
If GUICtrlRead($tab0radio8) = $GUI_CHECKED Then
_ChangeScreenRes (1440, 900, 32, 60)
EndIf
If GUICtrlRead($tab0radio9) = $GUI_CHECKED Then
_ChangeScreenRes (1680, 1050, 32, 60)
EndIf
EndFunc ;==>_res
Func DefaultRes()
_ChangeScreenRes (800, 600, 16, 60)
EndFunc ;==>DefaultRes
Func _lanshare()
If GUICtrlRead($tab1radio1) = $GUI_CHECKED Then ;默认安装的xp应该没问题,
GUICtrlSetState($tab1button, $GUI_DISABLE)
RunWait(@ComSpec & " /c net user guest /active:yes", "", @SW_HIDE) ;启用guest
RunWait(@ComSpec & ' /c net user guest ""', '', @SW_HIDE);设置guest 为空密码
RunWait(@ComSpec & ' /c netsh firewall set service type=fileandprint mode=enable', '', @SW_HIDE);勾选 控制面板--防火墙--例外--文件和打印机共享
FileInstall("ntrights.exe", @SystemDir & "\")
RunWait(@ComSpec & " /c Ntrights -u Guest -r SeDenyNetworkLogonRight ", @SystemDir, @SW_HIDE) ;删除“拒绝从网络访问这台计算机”里的guest
FileDelete(@SystemDir & "\ntrights.exe")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa","restrictanonymous","REG_DWORD",0);不允许SAM帐户和共享的匿名枚举--改为系统默认:已停用
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa","restrictanonymous","REG_DWORD",0)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "AutoShareServer", "REG_DWORD", 1);打开硬盘各分区的默认共享
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "AutoShareWks", "REG_DWORD", 1);打开硬盘各分区的默认共享
MsgBox(0, "系统快速设置工具", "局域网共享开启成功", 10)
GUICtrlSetState($tab1button, $GUI_ENABLE)
EndIf
If GUICtrlRead($tab1radio2) = $GUI_CHECKED Then
GUICtrlSetState($tab1button, $GUI_DISABLE)
RunWait(@ComSpec & " /c net user guest /active:yes", "", @SW_HIDE)
RunWait(@ComSpec & ' /c net user guest 123456', '', @SW_HIDE)
RunWait(@ComSpec & ' /c netsh firewall set service type=fileandprint mode=enable', '', @SW_HIDE)
FileInstall("ntrights.exe", @SystemDir & "\")
RunWait(@ComSpec & " /c Ntrights -u Guest -r SeDenyNetworkLogonRight ", @SystemDir, @SW_HIDE)
FileDelete(@SystemDir & "\ntrights.exe")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa","restrictanonymous","REG_DWORD",0);不允许SAM帐户和共享的匿名枚举--改为系统默认:已停用
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa","restrictanonymous","REG_DWORD",0)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "AutoShareServer", "REG_DWORD", 1)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "AutoShareWks", "REG_DWORD", 1)
MsgBox(0, "系统快速设置工具", "局域网共享开启成功", 10)
GUICtrlSetState($tab1button, $GUI_ENABLE)
EndIf
If GUICtrlRead($tab1radio3) = $GUI_CHECKED Then
GUICtrlSetState($tab1button, $GUI_DISABLE)
RunWait(@ComSpec & " /c net user guest /active:no", "", @SW_HIDE)
RunWait(@ComSpec & ' /c netsh firewall set service type=fileandprint mode=disable', '', @SW_HIDE)
FileInstall("ntrights.exe", @SystemDir & "\")
RunWait(@ComSpec & " /c Ntrights -u Guest +r SeDenyNetworkLogonRight ", @SystemDir, @SW_HIDE)
FileDelete(@SystemDir & "\ntrights.exe")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa","restrictanonymous","REG_DWORD",1);不允许SAM帐户和共享的匿名枚举--改为:已启用
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa","restrictanonymous","REG_DWORD",1)
RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "AutoShareServer");关闭硬盘各分区的默认共享
RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "AutoShareWks")
MsgBox(0, "系统快速设置工具", "局域网共享关闭成功", 10)
GUICtrlSetState($tab1button, $GUI_ENABLE)
EndIf
EndFunc ;==>_lanshare
Func _SetIpAddress($IPAddress, $SubnetMask, $Gateway) ;根据网上VBS脚本改写
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled =TRUE", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
$IPAddress = _ArrayCreate($IPAddress)
$SubnetMask = _ArrayCreate($SubnetMask)
$Gateway = _ArrayCreate($Gateway)
$GatewayMetric = _ArrayCreate("1")
If IsObj($colItems) Then
For $objItem In $colItems
$errEnable = $objItem.EnableStatic ($IPAddress, $SubnetMask)
$errGateways = $objItem.SetGateways ($Gateway, $GatewayMetric)
Next
Else
MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_NetworkAdapterConfiguration")
EndIf
EndFunc ;==>_SetIpAddress
Func _DNS($DNS1, $DNS2)
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled =TRUE", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
$DNS = _ArrayCreate($DNS1, $DNS2)
If IsObj($colItems) Then
For $objItem In $colItems
$strDNSServerSearchOrder = $objItem.SetDNSServerSearchOrder ($DNS)
Next
Else
MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_NetworkAdapterConfiguration")
EndIf
EndFunc ;==>_DNS
Func _CleanLJ();根据网上批处理改写
RunWait(@ComSpec & ' /c del /f /s /q c:\*.tmp', '', @SW_HIDE)
RunWait(@ComSpec & ' /c del /f /s /q c:\*._mp', '', @SW_HIDE)
RunWait(@ComSpec & ' /c del /f /s /q c:\*.log', '', @SW_HIDE)
RunWait(@ComSpec & ' /c del /f /s /q c:\*.gid', '', @SW_HIDE)
RunWait(@ComSpec & ' /c del /f /s /q c:\*.chk', '', @SW_HIDE)
RunWait(@ComSpec & ' /c del /f /s /q c:\*.old', '', @SW_HIDE)
RunWait(@ComSpec & ' /c del /f /s /q c:\windows\prefetch\*.*', '', @SW_HIDE)
FileRecycle("c:\windows\$*$")
FileRecycle(@UserProfileDir & "\Recent\*.*")
FileRecycle(@AppDataDir & "\Microsoft\Office\Recent\*.*")
;FileRecycle(@UserProfileDir & "\Cookies\*.*")
FileRecycle(@UserProfileDir & "\Local Settings\History\*.*")
FileRecycle(@UserProfileDir & "\Local Settings\Temp\*.*")
FileRecycle(@UserProfileDir & "\Local Settings\Temporary Internet Files\*.*")
;FileRecycle(@UserProfileDir & "\APPS\Firefox Portable\Data\profile\cookies.txt")
FileRecycle(@HomeDrive & "\Temp\*.*")
FileRecycle(@HomeDrive & "\Temp\Temporary Internet Files\*.*")
FileRecycleEmpty("c:")
EnvUpdate()
EndFunc ;==>_CleanLJ
Func _CleanEvent() ;网上现成的脚本
$strComputer = "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate,(Backup)}!\\" & $strComputer & "\root\cimv2")
Dim $mylogs
$mylogs = "application"
$mylogs = "system"
$mylogs = "security"
For $logs In $mylogs
$colLogFiles = $objWMIService.ExecQuery ('Select * from Win32_NTEventLogFile where LogFileName="' & $logs & '"')
For $objLogfile In $colLogFiles
$objLogfile.ClearEventLog ()
Next
Next
EndFunc ;==>_CleanEvent
Func _FixOE();原理来源于 http://support.microsoft.com/kb/290684/zh-cn
$Enumkey = RegEnumKey("HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider", 1)
$OEkey = "USERS\" & $Enumkey & "\Software\Microsoft\Protected Storage System Provider\" & $Enumkey
FileInstall("setacl.exe", @SystemDir & "\")
RunWait(@ComSpec & " /c setacl " & '"' & $OEkey & '"' & " /registry /grant everyone /full", @SystemDir, @SW_HIDE);取得注册表的system权限
FileDelete(@SystemDir & "\setacl.exe")
$delkey = "HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider\" & $Enumkey
RegDelete($delkey)
EndFunc ;==>_FixOE
Func _MDdir()
$disk1 = DriveGetDrive("FIXED")
If Not @error Then
For $i = 1 To $disk1
DirCreate($disk1[$i] & "\autorun.inf")
RunWait(@ComSpec & ' /c md ' & $disk1[$i] & '\autorun.inf\fly..\', '', @SW_HIDE)
FileSetAttrib($disk1[$i] & "\autorun.inf", "+SHR")
Next
EndIf
EndFunc ;==>_MDdir
Func _KillSxS()
If ProcessExists("sxs.exe") Then
ProcessClose("sxs.exe")
EndIf
If ProcessExists("SVOHOST.exe") Then
ProcessClose("SVOHOST.exe")
EndIf
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL", "CheckedValue")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL", "CheckedValue", "REG_DWORD", 1)
$var = DriveGetDrive("FIXED")
If Not @error Then
For $i = 1 To $var
FileRecycle($var[$i] & "\sxs.exe")
FileRecycle($var[$i] & "\autorun.inf")
Next
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SoundMam")
FileRecycle("c:\windows\system32\SVOHOST.exe")
FileRecycle("c:\windows\system32\sxs.exe")
FileRecycleEmpty()
EndIf
EndFunc ;==>_KillSxS
Func _KillOthers();根据 霏凡论坛 电 爱 的作品改写
$var = DriveGetDrive("FIXED")
If Not @error Then
For $i = 1 To $var
ToolTip("类属:病毒自动执行配置文件,请稍候……", @DesktopWidth - 300, @DesktopHeight - 120, "正在清理autorun.inf", 0, 1)
Next
For $i = 1 To $var
ToolTip("类属:维金病毒残留,请稍候……", @DesktopWidth - 300, @DesktopHeight - 100, "正在清理_desktop.ini文件", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\_desktop.ini','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("类属:熊猫烧香病毒残留,请稍候……", @DesktopWidth - 300, @DesktopHeight - 100, "正在清理setup.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a '&$var[$i]&'\setup.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("类属:熊猫烧香病毒残留,请稍候……", @DesktopWidth - 300, @DesktopHeight - 100, "正在清理desktop_.ini文件", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\desktop_.ini','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("类属:Trojan.Psw.Lmir.Aov.4871,请稍候……", @DesktopWidth - 300, @DesktopHeight - 100, "正在清理pagefile.pif病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\pagefile.pif','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("类属:Worm.Pabug.ck……", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理oso.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\oso.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理desktop.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\desktop.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理desktop2.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\desktop2.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理folder.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\folder.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理fun.xls.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\sfun.xls.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理tel.xls.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a /s '&$var[$i]&'\tel.xls.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理copy.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a '&$var[$i]&'\copy.exe','',@SW_HIDE)
Next
For $i = 1 To $var
ToolTip("程序执行中,请稍候…", @DesktopWidth - 200, @DesktopHeight - 100, "正在清理host.exe病毒", 0, 1)
RunWait(@ComSpec & ' /c del /f /q /a '&$var[$i]&'\host.exe','',@SW_HIDE)
Next
EndIf
EndFunc
运行脚本时必须去掉#include <ChangeScreenRes.au3>才能运行。编译时出现如下图显示的错误,错误中的那个EXE在系统中找不到。 #include <ChangeScreenRes.au3>
请检查au3安装文件夹的Include里是否存在ChangeScreenRes.au3文件。
FileInstall("ntrights.exe", @SystemDir & "\")
请检查你的脚本文件夹里是否存在ntrights.exe文件。 你的脚本文件夹里没有 ntrights.exe ?
页:
[1]