|
楼主 |
发表于 2010-6-7 13:08:55
|
显示全部楼层
谁 能帮我分析下 这里的 "自动登录", 是怎么做的 我怎么加代码都掉不出来"自动登录",
谢谢各位了
#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_UseAnsi=y ;编码
#AutoIt3Wrapper_Icon=E:\ICO\My Computer.ico ;图标
#AutoIt3Wrapper_Outfile=MYSET.exe ;输出文件名
#AutoIt3Wrapper_Outfile_Type=exe ;文件类型
#AutoIt3Wrapper_Compression=4 ;压缩等级
#AutoIt3Wrapper_UseUpx=y ;使用压缩
#AutoIt3Wrapper_Res_Comment=完成于2008/05/16 ;注释
#AutoIt3Wrapper_Res_Description=电脑室专用设置优化工具 ;详细信息
#AutoIt3Wrapper_Res_Fileversion=1.0.2.2
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=P ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright=电脑室 ;版权
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy= ;脚本整理
#AutoIt3Wrapper_Run_Obfuscator=1 ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check= ;语法检查
;#AutoIt3Wrapper_Run_Before= ;运行前
;#AutoIt3Wrapper_Run_After= ;运行后
#EndRegion AutoIt3Wrapper 预编译参数(常用参数)
#cs ____________________________________
脚本作者: 电脑室 By 37℃
脚本版本: 1.0.2.1
脚本功能: 系统设置
#ce _______________脚本开始_________________
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <GuiStatusBar.au3>
$Form1 = GUICreate("系统设置 V" & @YEAR & @MON & @MDAY & @HOUR & @MIN, 637, 425)
$ButtonExit = GUICtrlCreateButton("退 出", 550, 360, 50, 25, 0)
$Group1 = GUICtrlCreateGroup("分辨率设置", 8, 3, 193, 60)
$Group2 = GUICtrlCreateGroup("网络设置", 8, 70, 193, 105)
$Group3 = GUICtrlCreateGroup("安全设置", 208, 3, 417, 172)
$Group4 = GUICtrlCreateGroup("系统优化", 10, 180, 615, 215)
$ipAdd = GUICtrlCreateInput("192.168.1.", 80, 86, 108, 21)
$Hostname = GUICtrlCreateInput("HOME-00", 91, 114, 97, 21)
$Hostname1 = GUICtrlCreateInput("00", 64, 142, 57, 21)
$Label1 = GUICtrlCreateLabel("IP地址:", 16, 89, 50, 17)
$Label2 = GUICtrlCreateLabel("计算机名:", 16, 118, 64, 17)
$Label3 = GUICtrlCreateLabel("描述:", 16, 146, 41, 17)
$Button1 = GUICtrlCreateButton("开始", 137, 142, 51, 21, 0)
$Radio1 = GUICtrlCreateRadio("1024 x 768 x 32 @ 85MHz", 24, 16, 161, 17)
$Radio2 = GUICtrlCreateRadio("800 x 600 x 32 @ 100MHz", 24, 40, 153, 17)
$Button2 = GUICtrlCreateButton("开关机加速", 225, 20, 90, 25, 0)
$Button3 = GUICtrlCreateButton("清除IE首页", 324, 20, 90, 25, 0)
$Button4 = GUICtrlCreateButton("控制面板锁定", 422, 20, 90, 25, 0)
$Button5 = GUICtrlCreateButton("控制面板解锁", 521, 20, 90, 25, 0)
$Button6 = GUICtrlCreateButton("任务管理器锁定", 225, 60, 90, 25, 0)
$Button7 = GUICtrlCreateButton("任务管理器解锁", 325, 60, 90, 25, 0)
$Button8 = GUICtrlCreateButton("隐藏用户帐户", 422, 60, 90, 25, 0)
$Button9 = GUICtrlCreateButton("显示用户帐户", 521, 60, 90, 25, 0)
$Button10 = GUICtrlCreateButton("任务栏锁定", 225, 100, 90, 25, 0)
$Button11 = GUICtrlCreateButton("任务栏解锁", 324, 100, 90, 25, 0)
$Button12 = GUICtrlCreateButton("U盘只读", 422, 100, 90, 25, 0)
$Button13 = GUICtrlCreateButton("U盘解锁", 521, 100, 90, 25, 0)
$Button14 = GUICtrlCreateButton("注册表锁定", 225, 140, 90, 25, 0)
$Button15 = GUICtrlCreateButton("注册表解锁", 324, 140, 90, 25, 0)
$Button16 = GUICtrlCreateButton("任务管理器", 422, 140, 90, 25, 0)
$Button17 = GUICtrlCreateButton("MSCONFIG", 521, 140, 90, 25, 0)
$Button18 = GUICtrlCreateButton("系统属性", 30, 200, 90, 25, 0)
$Button19 = GUICtrlCreateButton("显示属性", 130, 200, 90, 25, 0)
$Button20 = GUICtrlCreateButton("网络连接", 230, 200, 90, 25, 0)
$Button21 = GUICtrlCreateButton("区域和语言", 330, 200, 90, 25, 0)
$Button22 = GUICtrlCreateButton("快捷方式优化", 430, 200, 90, 25, 0)
$Button23 = GUICtrlCreateButton("自动登录", 530, 200, 90, 25, 0)
$Button24 = GUICtrlCreateButton("复制到移动到", 30, 240, 90, 25, 0)
$Button25 = GUICtrlCreateButton("高级搜索", 130, 240, 90, 25, 0)
$Button26 = GUICtrlCreateButton("NUM键状态", 230, 240, 90, 25, 0)
$Button27 = GUICtrlCreateButton("加屏保密码", 330, 240, 90, 25, 0)
$Button28 = GUICtrlCreateButton("去屏保密码", 430, 240, 90, 25, 0)
$Button29 = GUICtrlCreateButton("取消自动登陆", 530, 240, 90, 25, 0)
$Button30 = GUICtrlCreateButton("修改IE标题", 30, 280, 90, 25, 0)
$Button31 = GUICtrlCreateButton("组策略", 130, 280, 90, 25, 0)
$Button32 = GUICtrlCreateButton("注册表编辑", 230, 280, 90, 25, 0)
$Button33 = GUICtrlCreateButton("添加删除程序", 330, 280, 90, 25, 0)
$Button34 = GUICtrlCreateButton("服务设置", 430, 280, 90, 25, 0)
$Button35 = GUICtrlCreateButton("设备管理器", 530, 280, 90, 25, 0)
$Button36 = GUICtrlCreateButton("关闭分组相似", 30, 320, 90, 25, 0)
$Button37 = GUICtrlCreateButton("不缓存缩略图", 130, 320, 90, 25, 0)
$Button38 = GUICtrlCreateButton("关闭系统还原", 230, 320, 90, 25, 0)
$Button39 = GUICtrlCreateButton("显示状态栏", 330, 320, 90, 25, 0)
$Button40 = GUICtrlCreateButton("禁用USB设备", 430, 320, 90, 25, 0)
$Button41 = GUICtrlCreateButton("启用USB设备", 530, 320, 90, 25, 0)
$Button42 = GUICtrlCreateButton("禁用系统还原", 30, 360, 90, 25, 0)
$Button43 = GUICtrlCreateButton("系统优化", 130, 360, 90, 25, 0)
$Button44 = GUICtrlCreateButton("禁用文件夹选项", 230, 360, 90, 25, 0)
$Button45 = GUICtrlCreateButton("开启硬件优化", 330, 360, 90, 25, 0)
$Button46 = GUICtrlCreateButton("禁用空间不足警告", 430, 360, 105, 25, 0)
$ty = ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon")
$typsd = ("DefaultPassword")
$psd = RegRead($ty, $typsd)
$SCR = "1"
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Dim $StatusBar1_PartsWidth[3] = [100, 220, 400]
Dim $S0 = " ", $S1 = "电脑室 By 37℃", $S2
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar1, $S2, 2)
_GUICtrlStatusBar_SetText($StatusBar1, $S1, 1)
_GUICtrlStatusBar_SetText($StatusBar1, $S0, 0)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 15)
$WinSub1 = GUICreate("自动登录", 234, 138, 272, 159)
$Label001 = GUICtrlCreateLabel("用户名:", 24, 24, 52, 17)
$Label002 = GUICtrlCreateLabel("密码:", 24, 50, 40, 17)
$Input002 = GUICtrlCreateInput("", 88, 46, 121, 21, $ES_PASSWORD)
$Input001 = GUICtrlCreateInput(@UserName, 88, 22, 121, 21)
$Button001 = GUICtrlCreateButton("设置自动登录", 22, 88, 83, 25, 0)
$Button002 = GUICtrlCreateButton("取消自动登录", 134, 88, 83, 25, 0)
GUISwitch($Form1)
GUISetState(@SW_SHOW)
;~ $sUsS = @UserName ;环境验证取值,可以取硬件身份码
;~ $sUsN = "电脑室" ;环境验证资料
;~ $sUsP = @MDAY ;验证权限密码大家自己设置,最好设置动态的
;~ If $sUsS = $sUsN Then
;~ Else
;~ $sUsPi = InputBox("权限核查", "请输入密码:","", "*",200,80)
;~ If $sUsPi = $sUsP Then
;~
;~ Else
;~ MsgBox(0,"","哎呀,你想干撒子!")
;~ Exit
;~ EndIf
;~ EndIf
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $ButtonExit
Exit
Case $nMsg = $Button1
$ipAdd = GUICtrlRead($ipAdd)
$Hostname = GUICtrlRead($Hostname)
$Hostname1 = GUICtrlRead($Hostname1)
$Mask = "255.255.255.0"
$Gateway = "202.202.220.21"
MsgBox(0, "确认IP地址", " " & $ipAdd & " ")
MsgBox(0, "确认计算机名", " " & $Hostname & " ")
MsgBox(0, "确认子网掩码", " " & $Mask & " ")
MsgBox(0, "确认网关", " " & $Gateway & " ")
MsgBox(0, "确认计算机描述", " " & $Hostname1 & " ")
$OK = MsgBox(1, "确认", "确认更改以上设置吗?")
If $OK = 2 Then ExitLoop
$SetName = _SetComputerName($Hostname, $Hostname1)
$SetIpAdd = _SetIp($ipAdd, $Mask, $Gateway)
MsgBox(0, "OK!", "更改完成")
ExitLoop
Case $nMsg = $Radio1
$SCR = MsgBox(1, "提示", "确认更改为[1024 x 768 x 32 @ 85MHz]!")
If $SCR = 1 Then
$1 = _ChangeScreenRes(1024, 768, 32, 85)
Else
ExitLoop
EndIf
Case $nMsg = $Radio2
MsgBox(1, "提示", "确认更改为[800 x 600 x 32 @ 100MHz]!")
If $SCR = 1 Then
$2 = _ChangeScreenRes(800, 600, 32, 100)
Else
ExitLoop
EndIf
Case $nMsg = $Button2
RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Desktop", "AutoEndTasks", "REG_SZ", "1")
RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Desktop", "HungAppTimeout", "REG_SZ", "50")
RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Desktop", "MenuShowDelay", "REG_SZ", "0")
RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Desktop", "WaitToKillAppTimeout", "REG_SZ", "100")
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "AutoEndTasks", "REG_SZ", "1")
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "HungAppTimeout", "REG_SZ", "50")
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "MenuShowDelay", "REG_SZ", "0")
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WaitToKillAppTimeout", "REG_SZ", "100")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control", "WaitToKillServiceTimeout", "REG_SZ", "1000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Shutdown", "FastReboot", "REG_SZ", "1")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management", "ClearPageFileAtShutdown", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", "ClearPageFileAtShutdown", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters", "EnablePrefetcher", "REG_DWORD", "00000001")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\lanmanserver\parameters", "autosharewks", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem", "aConfigFileAllocSize", "REG_DWORD", "000001f4")
MsgBox(64, "提示", "加速成功!")
Case $nMsg = $Button3
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "about:blank")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "about:blank")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel", "HomePage", "REG_DWORD", "00000000")
MsgBox(64, "提示", "IE已恢复空白页!")
Case $nMsg = $Button4
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoControlPanel", "REG_DWORD", "00000001")
MsgBox(64, "提示", "控制面板锁定成功!")
Case $nMsg = $Button5
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoControlPanel")
MsgBox(64, "提示", "控制面板解锁成功!")
Case $nMsg = $Button6
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableTaskMgr", "REG_DWORD", "00000001")
MsgBox(64, "提示", "任务管理器锁定成功!")
Case $nMsg = $Button7
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableTaskMgr")
MsgBox(64, "提示", "任务管理器解锁成功!")
Case $nMsg = $Button8
RegWrite("HKEY_CURRENT_USER\Control Panel\don't load", "nusrmgr.cpl", "REG_SZ", "no")
MsgBox(64, "提示", "用户帐户隐藏成功!")
Case $nMsg = $Button9
RegDelete("HKEY_CURRENT_USER\Control Panel\don't load", "nusrmgr.cpl")
MsgBox(64, "提示", "用户帐户显示成功!")
Case $nMsg = $Button10
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetTaskbar", "REG_DWORD", "00000001")
MsgBox(64, "提示", "任务栏锁定成功!")
Case $nMsg = $Button11
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetTaskbar")
MsgBox(64, "提示", "任务栏解锁成功!")
Case $nMsg = $Button12
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "00000001")
MsgBox(64, "提示", "U盘锁定成功!")
Case $nMsg = $Button13
RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect")
MsgBox(64, "提示", "U盘解锁成功!")
Case $nMsg = $Button14
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools", "REG_DWORD", "00000001")
MsgBox(64, "提示", "注册表锁定成功!")
Case $nMsg = $Button15
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools")
MsgBox(64, "提示", "注册表解锁成功!")
Case $nMsg = $Button16
Run(@SystemDir & "\taskmgr.exe")
Case $nMsg = $Button17
Run(@WindowsDir & "\pchealth\helpctr\binaries\msconfig.exe")
Case $nMsg = $Button18
Run(@ComSpec & ' /c sysdm.cpl', "", @SW_HIDE)
Case $nMsg = $Button19
Run("control Desk.cpl")
Case $nMsg = $Button20
Run("control Ncpa.cpl")
Case $nMsg = $Button21
Run("control Intl.cpl")
Case $nMsg = $Button22
RegDelete('HKEY_CLASSES_ROOT\lnkfile', "IsShortcut")
RegDelete('HKEY_CLASSES_ROOT\piffile', "IsShortcut")
RegWrite('HKEY_CLASSES_ROOT\lnkfile', "", "REG_SZ", "快捷方式")
RegWrite('HKEY_CLASSES_ROOT\lnkfile', "EditFlags", "REG_DWORD", '1')
RegWrite('HKEY_CLASSES_ROOT\lnkfile', "NeverShowExt", "REG_SZ", "")
RegWrite('HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer', "Link", "REG_BINARY", '00000000')
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer', "Link", "REG_BINARY", '00000000')
MsgBox(64, "提示", "快捷方式优化成功!")
Case $nMsg = $Button23
GUISetState(@SW_SHOW, $WinSub1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button002
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 $Button001
$username = GUICtrlRead($Input001)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 1)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", $username)
$password = GUICtrlRead($Input002)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", $password)
MsgBox(0, "系统快速设置工具", "设置成功,重启计算机生效", 2)
ExitLoop
EndSwitch
WEnd
Case $nMsg = $Button24
RegWrite('HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\Copy To', "", "REG_SZ", "{7BA4C740-9E81-11CF-99D3-00AA004AE837}")
RegWrite('HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\copyto', "", "REG_SZ", "{C2FBB630-2971-11D1-A18C-00C04FD75D13}")
RegWrite('HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\Move To', "", "REG_SZ", "{C2FBB631-2971-11D1-A18c-00C04FD75D13}")
RegWrite('HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\moveto', "", "REG_SZ", "{C2FBB631-2971-11D1-A18C-00C04FD75D13}")
MsgBox(64, "提示", "添加成功!")
Case $nMsg = $Button25
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Search Assistant', "Actor", "REG_SZ", "")
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Search Assistant', "SocialUI", "REG_DWORD", '0')
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Search Assistant', "UsageCount", "REG_DWORD", '0')
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Search Assistant', "UseAdvancedSearchAlways", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button26
RegWrite('HKEY_CURRENT_USER\Control Panel\Keyboard', "InitialKeyboardIndicators", "REG_SZ", "2")
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button27
RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', "ScreenSaverIsSecure", "REG_SZ", "1")
MsgBox(64, "提示", "修改成功!密码为登陆密码.")
Case $nMsg = $Button28
RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', "ScreenSaverIsSecure", "REG_SZ", "0")
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button29
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 $nMsg = $Button30
$name = InputBox("IE标题", "请输入自定义IE标题:", "电脑室", "", 200, 100)
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', "Window Title", "REG_SZ", $name)
Case $nMsg = $Button31
RunWait(@SystemDir & "\mmc.exe %SystemRoot%\system32\gpedit.msc")
Case $nMsg = $Button32
RunWait(@SystemDir & "\regedt32.exe")
Case $nMsg = $Button33
RunWait(@SystemDir & "\control.exe appwiz.cpl")
Case $nMsg = $Button34
RunWait(@SystemDir & "\mmc.exe %SystemRoot%\system32\services.msc")
Case $nMsg = $Button35
RunWait(@SystemDir & "\mmc.exe %SystemRoot%\system32\devmgmt.msc")
Case $nMsg = $Button36
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', "TaskbarGlomming", "REG_DWORD", '0')
RegWrite('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', "TaskbarGlomming", "REG_DWORD", '0')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button37
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', "DisableThumbnailCache", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button38
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore', "DisableSR", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button39
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', "ShowStatusBar", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button40
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR', "Start", "REG_DWORD", '4')
MsgBox(64, "提示", "修改成功,再插入的USB设备将无法使用!")
Case $nMsg = $Button41
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR', "Start", "REG_DWORD", '3')
MsgBox(64, "提示", "修改成功,请重新插入USB设备!")
Case $nMsg = $Button42
RRegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore', "DisableSR", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button43
RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', "AutoEndTasks", "REG_SZ", "1")
RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', "HungAppTimeout", "REG_SZ", "50")
RegWrite('HKEY_CURRENT_USER\Control Panel\Desktop', "WaitToKillAppTimeout", "REG_SZ", "200")
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters', "EnablePrefetcher", "REG_DWORD", '1')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer', "AlwaysUnloadDLL", "REG_DWORD", '1')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control', "WaitToKillServiceTimeout", "REG_SZ", "500")
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', "ClearRecentDocsOnEixt", "REG_BINARY", '01000000')
MsgBox(64, "提示", "系统优化成功!")
Case $nMsg = $Button44
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', "NoFolderOptions", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
Case $nMsg = $Button45
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vxd\BIOS', "CPUPriority", "REG_DWORD", '1')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vxd\BIOS', "PCIConcur", "REG_DWORD", '1')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vxd\BIOS', "FastDRAM", "REG_DWORD", '1')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Vxd\BIOS', "AGPConcur", "REG_DWORD", '1')
MsgBox(64, "提示", "硬件优化成功!")
Case $nMsg = $Button46
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer', "NoLowDiskSpaceChecks", "REG_DWORD", '1')
MsgBox(64, "提示", "修改成功!")
EndSelect
WEnd
Func _ChangeScreenRes($i_Width = @DesktopWidth, $i_Height = @DesktopHeight, $i_BitsPP = @DesktopDepth, $i_RefreshRate = @DesktopRefresh)
Local Const $DM_PELSWIDTH = 0x00080000
Local Const $DM_PELSHEIGHT = 0x00100000
Local Const $DM_BITSPERPEL = 0x00040000
Local Const $DM_DISPLAYFREQUENCY = 0x00400000
Local Const $CDS_TEST = 0x00000002
Local Const $CDS_UPDATEREGISTRY = 0x00000001
Local Const $DISP_CHANGE_RESTART = 1
Local Const $DISP_CHANGE_SUCCESSFUL = 0
Local Const $HWND_BROADCAST = 0xffff
Local Const $WM_DISPLAYCHANGE = 0x007E
If $i_Width = "" Or $i_Width = -1 Then $i_Width = @DesktopWidth ; default to current setting
If $i_Height = "" Or $i_Height = -1 Then $i_Height = @DesktopHeight ; default to current setting
If $i_BitsPP = "" Or $i_BitsPP = -1 Then $i_BitsPP = @DesktopDepth ; default to current setting
If $i_RefreshRate = "" Or $i_RefreshRate = -1 Then $i_RefreshRate = @DesktopRefresh ; default to current setting
Local $DEVMODE = DllStructCreate("byte[32];int[10];byte[32];int[6]")
Local $B = DllCall("user32.dll", "int", "EnumDisplaySettings", "ptr", 0, "long", 0, "ptr", DllStructGetPtr($DEVMODE))
If @error Then
$B = 0
SetError(1)
Return $B
Else
$B = $B[0]
EndIf
If $B <> 0 Then
DllStructSetData($DEVMODE, 2, BitOR($DM_PELSWIDTH, $DM_PELSHEIGHT, $DM_BITSPERPEL, $DM_DISPLAYFREQUENCY), 5)
DllStructSetData($DEVMODE, 4, $i_Width, 2)
DllStructSetData($DEVMODE, 4, $i_Height, 3)
DllStructSetData($DEVMODE, 4, $i_BitsPP, 1)
DllStructSetData($DEVMODE, 4, $i_RefreshRate, 5)
$B = DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_TEST)
If @error Then
$B = -1
Else
$B = $B[0]
EndIf
Select
Case $B = $DISP_CHANGE_RESTART
$DEVMODE = ""
Return 2
Case $B = $DISP_CHANGE_SUCCESSFUL
DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_UPDATEREGISTRY)
DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND_BROADCAST, "int", $WM_DISPLAYCHANGE, _
"int", $i_BitsPP, "int", $i_Height * 2 ^ 16 + $i_Width)
$DEVMODE = ""
Return 1
Case Else
$DEVMODE = ""
SetError(1)
Return $B
EndSelect
EndIf
EndFunc
Func _SetIp($ipAdd, $Mask, $Gateway)
$objWMIService = ObjGet("winmgmts:\\" & "." & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled =TRUE")
$ipAdd = _ArrayCreate($ipAdd)
$Mask = _ArrayCreate($Mask)
$Gateway = _ArrayCreate($Gateway)
$GatewayMetric = _ArrayCreate("1")
For $objItem In $colItems
$errEnable = $objItem.EnableStatic($ipAdd, $Mask)
$errGateways = $objItem.SetGateways($Gateway, $GatewayMetric)
Next
EndFunc
Func _SetComputerName($strComputerName, $Hostname1)
$SetKey1 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\"
$CtrlKey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\"
$Return = RegWrite($SetKey1 & "Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $strComputerName)
RegWrite($SetKey1 & "Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $strComputerName)
RegWrite($SetKey1 & "Services\Tcpip\Parameters", "Hostname", "REG_SZ", $strComputerName)
RegWrite($CtrlKey & "Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $strComputerName)
RegWrite($CtrlKey & "Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $strComputerName)
RegWrite($CtrlKey & "Services\Tcpip\Parameters", "Hostname", "REG_SZ", $strComputerName)
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters', "srvcomment", "REG_SZ", $Hostname1)
$str1 = StringRegExp($strComputerName, ".*(.{3})", 1)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters", "VirtualNetworkNumber", "REG_DWORD", "0x" & $str1[0])
Return $Return
EndFunc
Func RgWrite()
Dim $key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
RegWrite($key, 'DefaultUserName', 'REG_SZ', GUICtrlRead($Input1))
RegWrite($key, 'DefaultPassword', 'REG_SZ', GUICtrlRead($input2))
RegWrite($key, 'AutoAdminLogon', 'REG_SZ', 1)
EndFunc
Func begin()
$box = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName")
$name = InputBox("自动登陆设置", "请输入您要自动登陆的用户名", $box, "", 200, 100)
$pass = InputBox("自动登陆设置", "请输入您要自动登陆的用户密码", "", "*", 200, 100)
If $name <> "" And $pass <> "" Then
$rady = MsgBox(4, "自动登陆设置", "所有的输入都正确吗?")
If $rady = 6 Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "reg_sz", $name) ;====>把前面输入的值写入注册表
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassWord", "reg_sz", $pass) ;====>把前面输入的值写入注册表
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon", "AutoAdminLogon", "reg_sz", "1") ;====>新建一个键值
$exit = MsgBox(4, "恭喜你!", "所有的设置都很成功重启之后就能生效了确定要重启系统吗?")
If $exit = 6 Then
Shutdown(6)
ElseIf $exit = 7 Then
Exit
EndIf
ElseIf $rady = 7 Then
begin()
EndIf
Else
error()
EndIf
EndFunc
Func error()
$error = MsgBox(4, "出错拉!", "您可能没有输入用户名或密码,是否重新输入")
If $error = 6 Then
begin()
Else
Exit
EndIf
EndFunc |
|