#RequireAdmin
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\icon\systemcon.ico
#AutoIt3Wrapper_outfile=systemsetup.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;设置首页为 http://www.2345.com/?kruicheng
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Default_Page_URL","reg_sz","http://www.2345.com/?kruicheng")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page","reg_sz","http://www.2345.com/?kruicheng")
;设置电源
;Runwait(@ComSpec & " /c " & 'powercfg -h off', "", @SW_HIDE) 关闭休眠
Runwait(@ComSpec & " /c " & 'powercfg /change /monitor-timeout-ac 0', "", @SW_HIDE)
Runwait(@ComSpec & " /c " & 'powercfg /change /disk-timeout-ac 0', "", @SW_HIDE)
Runwait(@ComSpec & " /c " & 'powercfg /change /standby-timeout-ac 0', "", @SW_HIDE)
Runwait(@ComSpec & " /c " & 'powercfg /change /hibernate-timeout-ac 0', "", @SW_HIDE)
#cs
cmd 命令powercfg
powercfg /create lenovo
powercfg /change lenovo /monitor-timeout-ac 0 显示器
powercfg /change lenovo /disk-timeout-ac 0 硬盘
powercfg /change lenovo /standby-timeout-ac 0 待机
powercfg /change lenovo /hibernate-timeout-ac 0 休眠
powercfg /setactive lenovo
#ce
;关闭防火墙 Windows Firewall
;RunWait(@ComSpec & " /c " & 'netsh firewall set opmode disable', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'sc stop MpsSvc', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'sc config MpsSvc start= demand', "", @SW_HIDE)
;关闭自动更新 Windows Update
RunWait(@ComSpec & " /c " & 'sc stop wuauserv', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'sc config wuauserv start= demand', "", @SW_HIDE)
;关闭安全中心 Security Center
RunWait(@ComSpec & " /c " & 'sc stop wscsvc', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'sc config wscsvc start= demand', "", @SW_HIDE)
;关闭 Windows Defender
RunWait(@ComSpec & " /c " & 'sc stop WinDefend', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'sc config WinDefend start= demand', "", @SW_HIDE)
#cs
关闭服务的命令
echo stop Windows Update
sc stop wuauserv
sc config wuauserv start= disabled
echo stop Security Center
sc stop wscsvc
sc config wscsvc start= disabled
echo stop Windows Defender
sc stop WinDefend
sc config WinDefend start= disabled
echo stop Windows Firewall
sc stop MpsSvc
sc config MpsSvc start= disabled
#ce
;建立宽带连接
If @OSVersion="WIN_7" Then
$pbkpath=@AppDataDir&"\Microsoft\Network\Connections\Pbk\rasphone.pbk"
If FileExists($pbkpath) And FileGetSize($pbkpath)/1024>1.5 Then
MsgBox(48,"温馨提示","宽带连接已存在!"&@CRLF&@CRLF&"如需重新建立,请先删除原来的宽带连接。",2)
Else
FileInstall("WIN_7_rasphone.pbk",$pbkpath,1)
FileInstall("WIN_7_宽带连接.lnk",@DesktopDir&"\宽带连接.lnk",1)
MsgBox(64,"温馨提示","宽带连接已建立!",2)
;Run(@ComSpec&" /c rasphone.exe -d 宽带连接","",@SW_HIDE)
EndIf
;关闭消息中心
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "HideSCAHealth", "REG_DWORD", "00000001")
ElseIf @OSVersion="WIN_XP" Then
$pbkpath=@AppDataCommonDir&"\Microsoft\Network\Connections\Pbk\rasphone.pbk"
If FileExists($pbkpath) And FileGetSize($pbkpath)/1024>1.5 Then
MsgBox(48,"温馨提示","宽带连接已存在!"&@CRLF&@CRLF&"如需重新建立,请先删除原来的宽带连接。",2)
Else
FileInstall("WIN_XP_rasphone.pbk",$pbkpath,1)
FileInstall("WIN_XP_宽带连接.lnk",@DesktopDir&"\宽带连接.lnk",1)
MsgBox(64,"温馨提示","宽带连接已建立!",3)
;Run(@ComSpec&" /c rasphone.exe -d 宽带连接","",@SW_HIDE)
EndIf
Else
MsgBox(16,"温馨提示","对不起,本程序只适用于Windows XP和Windows 7系统",2)
EndIf
#cs
Switch @OSVersion
Case "WIN_7"
$rasphone = @AppDataDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk" ;当前用户 Application Data 目录所在路径
JLKD()
Case "WIN_XP"
$rasphone = @AppDataCommonDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk"
JLKD()
EndSwitch
Func JLKD()
FileOpen($rasphone, 1)
If StringInStr(FileRead($rasphone), "[宽带连接]") = 0 Then
FileWriteLine($rasphone, "[宽带连接]")
FileWriteLine($rasphone, "Type=5")
FileWriteLine($rasphone, "PreviewDomain=0")
FileWriteLine($rasphone, "PreviewPhoneNumber=0" & @CRLF)
FileWriteLine($rasphone, "NETCOMPONENTS=")
FileWriteLine($rasphone, "ms_server=0")
FileWriteLine($rasphone, "ms_msclient=0" & @CRLF)
FileWriteLine($rasphone, "MEDIA=rastapi")
FileWriteLine($rasphone, "Port=PPPoE6-0")
FileClose($rasphone)
FileCreateShortcut(@WindowsDir & "\system32\rasphone.exe", @DesktopDir & "\宽带连接.lnk", @WindowsDir, " -d 宽带连接")
;Run(@ComSpec & " /c " & 'rasphone -d ADSL', "", @SW_HIDE)
Exit
EndIf
EndFunc ;==>JLKD
#ce