|
发表于 2009-4-25 19:08:09
|
显示全部楼层
#include
Opt("TrayIconHide", 1)
;设置热键==================================================
HotKeySet("{Esc}", "quit")
Func quit()
FileDelete(@TempDir&"\xpconfig\VidChng.exe")
FileDelete(@TempDir&"\xpconfig\ConvertNTFS.exe")
Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $main, "int", 300, "long", 0x00050010);fade-out
DirRemove(@TempDir&"\xpconfig")
exit
EndFunc
HotKeySet("^!{F7}","v0")
;建立窗口==================================================
DirCreate(@TempDir&"\xpconfig")
FileInstall("VidChng.exe",@TempDir&"\xpconfig\VidChng.exe")
FileInstall("logo_cfg.jpg",@TempDir&"\xpconfig\logo_cfg.jpg")
$main = GUICreate ("系统快速设置工具 V4.3",400,300,-1,-1)
GuiCtrlCreatePic(@TempDir&"\xpconfig\logo_cfg.jpg",0,0, 400,90)
GUICtrlCreateLabel("│",260,281,120,16)
GUICtrlSetFont(-1, 16, 100, 0, "宋体")
GUICtrlSetState(-1, $GUI_DISABLE)
$link=GUICtrlCreateLabel("深度技术 小兵作品",280,284,110,12)
GUIctrlSetCursor($link,0)
$wait = 1000
$bar = GUICtrlCreateLabel("欢迎使用系统快速设置工具V4.3",10,284,250,12)
FileDelete(@TempDir&"\xpconfig\logo_cfg.jpg")
;------------------------
GUICtrlCreateTab (2,90,398,190)
GUICtrlCreateTabitem(" 优化 ")
$group_1 = GUICtrlCreateGroup ("系统服务优化", 15, 125, 370, 145)
$button_1 = GUICtrlCreateButton ("确 定", 300, 233, 70, 25)
GUIStartGroup()
$radio_01 = GUICtrlCreateRadio ("精简优化模式", 50, 155, 100, 15)
$radio_02 = GUICtrlCreateRadio ("家庭娱乐模式", 50, 175, 100, 15)
$radio_03 = GUICtrlCreateRadio ("办公优化模式", 50, 195, 100, 15)
$radio_04 = GUICtrlCreateRadio ("网吧优化模式", 150, 155, 100, 15)
$radio_05 = GUICtrlCreateRadio ("笔记本电脑优化模式", 150, 175, 125, 15)
$radio_06 = GUICtrlCreateRadio ("windows XP 默认设置", 150, 195, 130, 15)
$group_updata = GUICtrlCreateGroup ("打印选项", 25, 225, 260, 37)
if ProcessExists("spoolsv.exe") then
$radio_07 = GUICtrlCreateRadio ("启用打印服务", 50, 238, 100, 20)
GUICtrlSetState($radio_07, $GUI_CHECKED)
$radio_08 = GUICtrlCreateRadio ("关闭打印服务", 150, 238, 100, 20)
else
$radio_07 = GUICtrlCreateRadio ("启用打印服务", 50, 238, 100, 20)
$radio_08 = GUICtrlCreateRadio ("关闭打印服务", 150, 238, 100, 20)
GUICtrlSetState($radio_08, $GUI_CHECKED)
endif
$group_2 = GUICtrlCreateGroup ("操作系统", 295, 150, 80,60)
$win = GUICtrlCreateLabel(@OSVersion&@CR&@OSServicePack,310,168,70,50)
GUICtrlSetColor(-1, 0xFF0000)
;------------------------
GUICtrlCreateTabitem("分辨率")
$button_2 = GUICtrlCreateButton ("设 置", 300, 233, 70, 25)
GUICtrlCreateLabel("设置过高可能会导致黑屏,按下Ctrl+Alt+F7可迅速降低分辨率。",30,150,350,20)
$now = GUICtrlCreateLabel(@DesktopWidth&"×"&@DesktopHeight&@CR&@DesktopDepth&"色 "&@DesktopRefresh&"Hz",308,195,70,50)
GUICtrlSetColor(-1, 0xFF0000)
$group_2 = GUICtrlCreateGroup ("分辨率设置", 15, 125, 370, 145)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio ("800*600,60", 30, 168, 80, 15)
$radio_2 = GUICtrlCreateRadio ("800*600,72", 30, 184, 80, 15)
$radio_3 = GUICtrlCreateRadio ("800*600,85", 30, 200, 80, 15)
$radio_4 = GUICtrlCreateRadio ("1024*768,60", 112, 168, 85, 17)
$radio_5 = GUICtrlCreateRadio ("1024*768,72", 112, 184, 85, 17)
$radio_6 = GUICtrlCreateRadio ("1024*768,85", 112, 200, 85, 17)
$radio_7 = GUICtrlCreateRadio ("1280*1024,60", 200, 168, 90, 17)
$radio_8 = GUICtrlCreateRadio ("1280*1024,72", 200, 184, 90, 17)
$radio_9 = GUICtrlCreateRadio ("1280*1024,85", 200, 200, 90, 17)
$radio_15 = GUICtrlCreateRadio ("15寸宽屏", 40, 238, 70, 20)
$radio_17 = GUICtrlCreateRadio ("17寸宽屏", 120, 238, 70, 20)
$radio_19 = GUICtrlCreateRadio ("19寸宽屏", 200, 238, 70, 20)
$group_book = GUICtrlCreateGroup ("宽屏液晶", 25, 225, 260, 37)
$group_now = GUICtrlCreateGroup ("初始分辨率", 295, 171, 80,91)
;------------------------
GUICtrlCreateTabitem("C盘格式")
$group_3 = GUICtrlCreateGroup ("转换C盘分区格式", 15, 125, 370, 145)
$info3 = GUICtrlCreateLabel("NTFS格式是WinXP推荐使用的格式。转换为NTFS格式能提高硬盘"&@CR&"存储效率,并可设置访问权限以保护文件。但NTFS格式的分区在DOS/WIN9X下均不能被识别,可能会给初级用户造成不便。"&@CR&@CR&"如无必要请不要转换。",30,155,350,60)
$button_3 = GUICtrlCreateButton ("转 换", 300, 233, 70, 25)
$group_ntfs = GUICtrlCreateGroup ("文件系统", 25, 225, 260, 37)
$Label = GUICtrlCreateLabel("当前系统分区文件格式", 34, 242, 120, 16)
if DriveGetFileSystem("c:\")="NTFS" then
GUICtrlCreateLabel("NTFS", 159, 242, 233, 25)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel(",您不需要转换。", 186, 242, 233, 25)
Else
GUICtrlCreateLabel("Fat32", 157, 242, 233, 25)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("可以转换格式。", 190, 242, 233, 25)
endif
;------------------------
GUICtrlCreateTabitem("网络设置")
$group_4 = GUICtrlCreateGroup ("网络设置及局域网共享", 15, 125, 370, 145)
$cfgip = GUICtrlCreateradio ("使用下面的IP", 100, 145, 90, 13)
$autoip = GUICtrlCreateradio ("不更改", 30, 145, 65, 13)
GuiCtrlSetState(-1, $GUI_CHECKED)
$4_5 = GUICtrlCreateLabel (" IP 地址", 30, 167, 50, 15)
$ip = GUICtrlCreateInput("192.168.0.9", 90, 165, 100, 16, -1)
GuiCtrlSetState(-1, $GUI_DISABLE)
$4_6 = GUICtrlCreateLabel ("子网掩码", 30, 187, 50, 15)
$mask = GUICtrlCreateInput("255.255.255.0", 90, 185, 100, 16, -1)
GuiCtrlSetState(-1, $GUI_DISABLE)
$4_7 = GUICtrlCreateLabel ("默认网关", 30, 207, 50, 15)
$gate = GUICtrlCreateInput("192.168.0.1", 90, 205, 100, 16, -1)
GuiCtrlSetState(-1, $GUI_DISABLE)
$4_8 = GUICtrlCreateLabel ("首选 DNS", 30, 227, 50, 15)
$dns1 = GUICtrlCreateInput("202.97.224.69", 90, 225, 100, 16, -1)
GuiCtrlSetState(-1, $GUI_DISABLE)
$4_9 = GUICtrlCreateLabel ("备用 DNS", 30, 247, 50, 15)
$dns2 = GUICtrlCreateInput("202.97.230.4", 90, 245, 100, 16, -1)
GuiCtrlSetState(-1, $GUI_DISABLE)
GUIStartGroup()
$radio_44 = GUICtrlCreateradio ("打开磁盘共享", 210, 145, 170, 20)
$radio_45 = GUICtrlCreateradio ("关闭磁盘共享", 210, 165, 170, 15)
GUIStartGroup()
$radio_41 = GUICtrlCreateradio ("开通局域网共享(无需验证)", 210, 185, 170, 15)
$radio_42 = GUICtrlCreateradio ("开通局域网共享(需要密码)", 210, 205, 170, 15)
$radio_43 = GUICtrlCreateradio ("关闭共享", 210, 225, 70, 15)
$button_4 = GUICtrlCreateButton ("设 置", 300, 233, 70, 25)
;------------------------
GUICtrlCreateTabitem("OEM信息")
$group_5 = GUICtrlCreateGroup ("修改OEM信息", 15, 125, 370, 145)
$oemlink = GUICtrlCreateCheckbox ("启用开始菜单上的OEM链接", 30, 145, 180, 15)
$ShowOemlink = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartMenu\StartPanel\ShowOEMLink',"NoOEMLinkInstalled")
if $ShowOemlink = "0" then
GuiCtrlSetState(-1, $GUI_CHECKED)
endif
$text = RegRead ('HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}',"")
$tip = RegRead ('HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}',"InfoTip")
$ico = RegRead ('HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\DefaultIcon',"")
$to = RegRead ('HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\Instance\InitPropertyBag',"Param1")
$5_1 = GUICtrlCreateLabel ("文字", 30, 177, 25, 15)
$linkText = GUICtrlCreateInput($text, 62, 175, 130, 16, -1)
$5_2 = GUICtrlCreateLabel ("悬停", 30, 197, 25, 15)
$linkTip = GUICtrlCreateInput($tip, 62, 195, 130, 16, -1)
$5_3 = GUICtrlCreateLabel ("链接", 30, 217, 25, 15)
$linkto = GUICtrlCreateInput($to, 62, 215, 130, 16, -1)
$5_4 = GUICtrlCreateLabel ("图标", 30, 237, 25, 15)
$linkico = GUICtrlCreateInput($ico, 62, 235, 80, 16, -1)
$Openoemico = GUICtrlCreateButton("...", 150, 235, 40, 20)
$Owner = RegRead ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion',"RegisteredOwner")
$Organization = RegRead ('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion',"RegisteredOrganization")
$Manufacturer = IniRead(@systemDir & "\oeminfo.ini","General","Manufacturer","")
$5_5 = GUICtrlCreateLabel ("注册姓名", 215, 145, 50, 15)
$name = GUICtrlCreateInput($Owner, 266, 143, 100, 16, -1)
$5_6 = GUICtrlCreateLabel ("注册组织", 215, 165, 50, 15)
$org = GUICtrlCreateInput($Organization, 266, 163, 100, 16, -1)
$5_7 = GUICtrlCreateLabel ("OEM图片", 215, 190, 50, 15)
$inputoemlogo = GUICtrlCreateInput(@systemDir & "\oemlogo.bmp", 266, 188, 60, 16, -1)
$Openoemlogo = GUICtrlCreateButton ("...", 330, 185, 40, 20)
$5_8 = GUICtrlCreateLabel ("OEM信息", 215, 210, 50, 15)
$oeminfo = GUICtrlCreateInput($Manufacturer, 266, 208, 60, 16, -1)
$editinfo = GUICtrlCreateButton ("...", 330, 205, 40, 20)
$sysdm = GUICtrlCreateButton ("系统属性", 220, 233, 70, 25)
$button_5 = GUICtrlCreateButton ("确 定", 300, 233, 70, 25)
;------------------------
GUICtrlCreateTabitem("清理选项")
$group_6 = GUICtrlCreateGroup ("清理系统垃圾", 15, 125, 370, 145)
$button_6 = GUICtrlCreateButton ("确 定", 300, 233, 70, 25)
$del1 = GUICtrlCreateCheckbox ("程序、安全性、系统日志", 40, 155, 160, 15)
$del2 = GUICtrlCreateCheckbox ("多余的桌面右键菜单", 40, 175, 160, 15)
$del3 = GUICtrlCreateCheckbox ("垃圾文件、临时文件", 40, 195, 160, 15)
$kill1 = GUICtrlCreateCheckbox ("清除autorun.inf及U盘病毒", 200, 155, 180, 15)
$kill2 = GUICtrlCreateCheckbox ("清除所有的 _desktop.ini", 200, 175, 180, 15)
$del4 = GUICtrlCreateCheckbox ("清除所有启动项目(慎用)", 200, 195, 180, 15)
$group_auto = GUICtrlCreateGroup ("光盘自动运行", 25, 225, 260, 37)
$radio_61 = GUICtrlCreateRadio ("关闭自动运行", 50, 238, 100, 20)
$radio_62 = GUICtrlCreateRadio ("恢复未配置状态", 150, 238, 100, 20)
;------------------------
GUICtrlCreateTabitem(" 小键盘 ")
$group_7 = GUICtrlCreateGroup ("设置笔记本小键盘", 15, 125, 370, 145)
$button_7 = GUICtrlCreateButton ("设 置", 300, 233, 70, 25)
$WshShell = ObjCreate("WScript.shell")
GUICtrlCreateLabel("笔记本由于键位限制,把数字小键盘与字母部分做到了一起,"&@CR&"安装GhostXP系统以后,由于小键盘一般都是默认打开状态,"&@CR&"使笔记本上的数字区域的键位发生变化,产生键盘错键现象。"&@CR&"通过 FN+NUMLOCK 或 SHIFT+NUMLOCK 可进行切换。",40,155,350,80)
$group_ntfs = GUICtrlCreateGroup ("小键盘设置", 25, 225, 260, 37)
GUICtrlCreateLabel("点击“设置”可关闭或打开小键盘。", 40, 242, 200, 16)
;------------------------
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $autoip
GUICtrlSetState($ip, $GUI_DISABLE)
GUICtrlSetState($mask, $GUI_DISABLE)
GUICtrlSetState($gate, $GUI_DISABLE)
GUICtrlSetState($dns1, $GUI_DISABLE)
GUICtrlSetState($dns2, $GUI_DISABLE)
Case $msg = $cfgip
GUICtrlSetState($ip, $GUI_ENABLE)
GUICtrlSetState($mask, $GUI_ENABLE)
GUICtrlSetState($gate, $GUI_ENABLE)
GUICtrlSetState($dns1, $GUI_ENABLE)
GUICtrlSetState($dns2, $GUI_ENABLE)
Case $msg = $sysdm
run("Control.exe sysdm.cpl ")
Case $msg = $Openoemlogo
$logoFile = FileOpenDialog ( "请选择文件", -1, "oemlogo位图(*.bmp)",2 )
IF $logoFile Then
GUICtrlSetData($inputoemlogo,$logoFile)
EndIf
Case $msg = $editinfo
ShellExecute(@systemDir & "\oeminfo.ini")
Case $msg = $Openoemico
$icoFile = FileOpenDialog ( "请选择文件", -1, "OemLinkIcon(*.ico)",2 )
IF $icoFile Then
GUICtrlSetData($linkico,$icoFile)
EndIf
Case $msg = $button_1
$button_0 = GUICtrlCreateButton ("确 定", 300, 233, 70, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("正在进行系统服务优化,请稍候",10,284,250,12)
if GUICtrlRead ( $Radio_01 )=1 then
moderefine()
endif
if GUICtrlRead ( $Radio_02 )=1 then
modehome()
endif
if GUICtrlRead ( $Radio_03 )=1 then
modeoffice()
endif
if GUICtrlRead ( $Radio_04 )=1 then
modebar()
endif
if GUICtrlRead ( $Radio_05 )=1 then
modenbook()
endif
if GUICtrlRead ( $Radio_06 )=1 then
modexp()
endif
if GUICtrlRead ( $Radio_07 )=1 then
modeSpooler()
endif
if GUICtrlRead ( $Radio_08 )=1 then
modenoSpooler()
endif
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("系统服务优化完成!",10,284,250,12)
MsgBox(64,"完成","系统优化完成,重启计算机生效!",3)
GUICtrlDelete($button_0)
Case $msg = $button_2
if GUICtrlRead ( $Radio_1 )=1 then
v1()
endif
if GUICtrlRead ( $Radio_2 )=1 then
v2()
endif
if GUICtrlRead ( $Radio_3 )=1 then
v3()
endif
if GUICtrlRead ( $Radio_4 )=1 then
v4()
endif
if GUICtrlRead ( $Radio_5 )=1 then
v5()
endif
if GUICtrlRead ( $Radio_6 )=1 then
v6()
endif
if GUICtrlRead ( $Radio_7 )=1 then
v7()
endif
if GUICtrlRead ( $Radio_8 )=1 then
v8()
endif
if GUICtrlRead ( $Radio_9 )=1 then
v9()
endif
if GUICtrlRead ( $Radio_15 )=1 then
v15()
endif
if GUICtrlRead ( $Radio_17 )=1 then
v17()
endif
if GUICtrlRead ( $Radio_19 )=1 then
v19()
endif
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("分辨率设置完成!",10,284,250,12)
Case $msg = $button_3
ntfs()
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("转换分区格式完成!重启生效!",10,284,250,12)
Case $msg = $button_4
FileInstall("关闭局域网共享.reg",@TempDir&"\xpconfig\关闭局域网共享.reg")
FileInstall("开通共享(无需验证).reg",@TempDir&"\xpconfig\开通共享(无需验证).reg")
FileInstall("开通共享(需要验证).reg",@TempDir&"\xpconfig\开通共享(需要验证).reg")
if GUICtrlRead ( $Radio_41 )=1 then
sharenopass()
endif
if GUICtrlRead ( $Radio_42 )=1 then
sharewithpass()
endif
if GUICtrlRead ( $Radio_43 )=1 then
noshare()
endif
if GUICtrlRead ( $Radio_44 )=1 then
AutoShare()
endif
if GUICtrlRead ( $Radio_45 )=1 then
noAutoShare()
endif
if GUICtrlRead ( $cfgip )=1 then
cfgip()
endif
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("网络设置完成!",10,284,250,12)
FileDelete(@TempDir&"\xpconfig\关闭局域网共享.reg")
FileDelete(@TempDir&"\xpconfig\开通共享(无需验证).reg")
FileDelete(@TempDir&"\xpconfig\开通共享(需要验证).reg")
Case $msg = $button_5
if GUICtrlRead ( $oemlink ) = "1" then
oemlink()
else
Noshowoemlink()
endif
reg()
$inputoemlogo_ = GUICtrlRead($inputoemlogo)
copyoemlogo()
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("OEM信息设置成功!",10,284,250,12)
MsgBox(64,"完成","OEM信息设置成功!",3)
Case $msg = $button_6
If GUICtrlRead($del1)=1 Then
_CleanEvent(1)
EndIf
If GUICtrlRead($del2)=1 Then
deldsk()
EndIf
If GUICtrlRead($del3)=1 Then
deltmp()
rrecent()
_Dirremove(@tempdir)
EndIf
If GUICtrlRead($kill1)=1 Then
_autorun()
EndIf
If GUICtrlRead($kill2)=1 Then
_desktop()
EndIf
If GUICtrlRead($Radio_61)=1 Then
autorun()
EndIf
If GUICtrlRead($Radio_62)=1 Then
autorun1()
EndIf
If GUICtrlRead($del4)=1 Then
delrun()
EndIf
ToolTip('', @DesktopWidth-0, @DesktopHeight-0)
MsgBox(64,"完成","清理完毕!",3)
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("系统清理完成!",10,284,250,12)
Case $msg = $button_7
$WshShell.SendKeys("{NUMLOCK}")
MsgBox(64,"完成","设置完成!请检查键盘NumLock灯!"&@CRLF&"再次运行可重新打开或关闭小键盘。",3)
GUICtrlDelete($bar)
$bar = GUICtrlCreateLabel("小键盘设置完成!",10,284,250,12)
Case $msg = $link
run(@ProgramFilesDir & "\Internet Explorer\IEXPLORE.EXE http://goto.blog.edu.cn")
Case $msg = $GUI_EVENT_CLOSE
quit()
EndSelect
Wend |
|