无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 4112|回复: 3
打印 上一主题 下一主题

pe开启网络及声音服务的Au3代码

[复制链接]
跳转到指定楼层
1#
发表于 2020-6-5 08:48:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#RequireAdmin
#Region ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
#PRE_Icon=hxwl.ico
#PRE_Outfile=恒信winPE系统网络部署工具.exe
#PRE_Outfile_x64=恒信winPE系统网络部署工具_x64.exe
#PRE_Compression=4
#PRE_UseUpx=y
#PRE_Compile_Both=y
#PRE_Res_Comment=恒信winPE系统网络部署工具
#PRE_Res_Description=恒信winPE系统网络部署工具,用于WinPe多系统部署 作者:恒信电脑
#PRE_Res_Fileversion=1.0.2.1
#PRE_Res_LegalCopyright=版权所有(C)2015-2020 三井子恒信电脑
#PRE_Res_Language=2052
#PRE_Res_requestedExecutionLevel=None
[url=mailto:#PRE_Res_Field=Email|sjzhxwy@163.com]#PRE_Res_Field=Email|sjzhxwy@163.com[/url]
#PRE_Res_Field=QQ/TM|18743805577
#PRE_Res_Field=作者:|恒信电脑
#PRE_Res_Field=产品版本|2020.05.6
#PRE_Add_Constants=y
#EndRegion ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
;#NoTrayIcon
;pe运行文件
#include <GuiConstants.au3>
#include <Array.au3>
#include <file.au3>
;#NoTrayIcon     ;不显示托盘图标,开启后也无托盘气泡提示!
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)
Local $_ProcessList = ProcessList(@ScriptName)
If $_ProcessList[0][0] > 1 Then Exit
$a=@OSVersion
$var=@StartMenuDir
$pl=StringMid(@StartMenuDir, 1, 2)
Dim $z,$i, $Drive,$xt, $l,$USB_OS,$NO,$NO1,$driveLetter
;/////////////////////通过寻找配置文件来定位驱动器盘符//////////////////////////////////////////////
For $i = 67 To 90 Step 1 ;计次循环23次,对应字母 D-Z
        $Drive = Chr($i)
        If FileExists($Drive  & ":\" &  "\PETOOLS\Other\NET.ini") Then
             $z=$Drive
   ; MsgBox(1,"老大","文件在 "& $Drive & ":盘")
     ; ShellExecuteWait($Drive & ":\" &  "lhtools.exe")
                EndIf
                ; MsgBox(1,"老大", $Drive & ":盘     "&"文件不纯在啊!!!")
Next

;//////////////检查配置文件///////////////////////////////////
$file = $z &":\PETOOLS\Other\NET.ini"
$soft_ini = FileOpen($file, 0)
If $soft_ini = -1 Then
MsgBox(16, "错误", '请检查配置文件是否存在!!!') ;@ScriptDir为脚本所在目录
ProcessClose("netjiance.dll")
Exit
EndIf
;////////////////读取磁盘美化配置//////////////////////////////////不设置了直接美化吧,默认


;/////////////读取网络配置文件//////////////////////////////////
$Network_ch= IniRead($file, "网卡", "Network", "");安装网络开关;ON=安装;off=不安装
$PENetwork = IniRead($file, "PE网络控制器", "PENetwork", "")
$OPERA = IniRead($file, "浏览器", "OPERA", "")
$TheWorld= IniRead($file, "浏览器", "TheWorld", "")
$NET = IniRead($file, "PE网络组件", "NET", "")
;/////////////////////////////////////////////

if $Network_ch="enable" Then
TrayTip("恒信提示", "正在加载网络组件 ...", 3,1)
if $NET="1" Then IN_NET()
if $PENetwork="1" Then PENetwork()
If $OPERA="1" Then OPERA()
If $TheWorld="1" Then TheWorld()
EndIf
;//////////////安装网络服务与驱动及网络共享////////////////////////////////
Func IN_NET()
;===============加载网络组建=================
TrayTip("恒信提示", "正在解压网络组件 ...", 3,1)

If @OSArch="X86" >0 Then
RunWait(@ComSpec & ' /c '&$pl&"\Tools\7-zip\7z.exe x "& $z &":\DLC\LAN_6.2.9200_x86.7z"""" -y -aos -o"&$pl&"\Windows","",@SW_HIDE)
EndIf
If  @OSArch="X64" >0 Then
RunWait(@ComSpec & ' /c '&$pl&"\Tools\7-zip\7z.exe x "& $z &":\DLC\LAN_6.2.9200_x64.7z"""" -y -aos -o"&$pl&"\Windows","",@SW_HIDE)
EndIf
RunWait(@ComSpec & ' /c netcfg.exe -v -winpe',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -c s -i MS_Server',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start TCPIP',"",@SW_HIDE)
TrayTip("恒信提示", "正在开启服务 ...", 3,1)
RunWait(@SystemDir & '\PECMD.exe SERV audiosrv',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c p -i MS_NDISWAN',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c s -i MS_RASMAN',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c p -i MS_PPPOE',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start TapiSvc',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start RasMan',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start RasAuto',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c p -i MS_NDISUIO',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg -c s -i ms_nativewifip',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c p -i ms_lltdio',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c p -i ms_rspndr',"",@SW_HIDE)
RunWait(@ComSpec & ' /c netcfg.exe -e -c p -i ms_lldp',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start dot3svc',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start Wlansvc',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start DHCP',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start LMHOSTS',"",@SW_HIDE)
RunWait(@SystemDir & '\PECMD.exe SERV SERVER',"",@SW_HIDE)
RunWait(@SystemDir & '\PECMD.exe SERV BFE',"",@SW_HIDE)
RunWait(@SystemDir & '\PECMD.exe SERV GPSVC',"",@SW_HIDE)
TrayTip("恒信提示", "正在 设置无密码的网络共享 ...", 3,1)
RunWait(@ComSpec & ' /c IPCONFIG >nul',"",@SW_HIDE)
RunWait(@ComSpec & ' /c NET USER Guest /active:yes',"",@SW_HIDE)
RunWait(@ComSpec & ' /c NET USER Guest /passwordreq:no',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start wcmsvc',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start nlasvc',"",@SW_HIDE)
RunWait(@ComSpec & ' /c net start netprofm',"",@SW_HIDE)
TrayTip("恒信提示", "正在 刷新系统 ...", 3,1)
RunWait(@SystemDir & '\PECMD.exe KILL explorer.exe',"",@SW_HIDE)
TrayTip("恒信提示", "正在安装网卡驱动 ...", 3,1)
RunWait(@SystemDir & '\PECMD.exe DEVI X:\Windows\CAB\LAN_x86.CAB,,%temp%',"",@SW_HIDE)
RunWait(@SystemDir & '\PECMD.exe TEMP @Delete',"",@SW_HIDE)
RunWait(@SystemDir & '\PECMD.exe DEVI %SystemRoot%\inf\hd*.inf',"",@SW_HIDE)
FileCreateShortcut(@SystemDir & "\PENetCfg.exe",$pl & "\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\网络工具\PENETCFG 网络设置.lnk")
FileCreateShortcut(@SystemDir & "\RASPHONE.PBK",$pl & "\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\网络工具\宽带连接.lnk")
EndFunc   ;==>net

;///////////安装浏览器//////////////////////////////
Func OPERA()
;=================安装OPERA浏览器=======================
TrayTip("恒信提示", "正在安装 欧鹏浏览器 ...", 5,1)
Sleep(1500)
RunWait(@ComSpec & ' /c '&$pl&"\Tools\7-zip\7z.exe x "& $z &":\DLC\TOOL\Opera_12.17.1863.7z"""" -y -aos -o"&$pl&"\EXTOOLS","",@SW_HIDE)
FileCreateShortcut($pl & "\EXTOOLS\Opera\Opera.exe",$pl & "\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\网络工具\Opera 浏览器.lnk","","http://www.2345.com/?ksjzhx","",$pl & "\EXTOOLS\Opera\TheWorld.ico")
FileCreateShortcut($pl & "\EXTOOLS\Opera\Opera.exe",$pl & "\Users\Default\Desktop\Opera 浏览器.lnk","","http://www.2345.com/?ksjzhx","",$pl & "\EXTOOLS\Opera\TheWorld.ico")
EndFunc   ;==>OPERA

Func TheWorld()
;=================安装世界之窗浏览器=======================
TrayTip("恒信提示", "正在安装 世界之窗浏览器 ...", 5,1)
Sleep(1500)
RunWait(@ComSpec & ' /c '&$pl&"\Tools\7-zip\7z.exe x "& $z &":\DLC\TOOL\TheWorld.7z"""" -y -aos -o"&$pl&"\EXTOOLS","",@SW_HIDE)
FileCreateShortcut($pl & "\EXTOOLS\TheWorld\TheWorld.exe",$pl & "\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\网络工具\世界之窗(浏览器).lnk","\EXTOOLS\TheWorld","http://www.2345.com/?ksjzhx","","\EXTOOLS\TheWorld\TheWorld.ico")
FileCreateShortcut($pl & "\EXTOOLS\TheWorld\TheWorld.exe",$pl & "\Users\Default\Desktop\浏览器.lnk","\EXTOOLS\TheWorld","http://www.2345.com/?ksjzhx","","\EXTOOLS\TheWorld\TheWorld.ico")
EndFunc   ;==>TheWorld

;////////////安装PENetwork网络控制器////////////////////////////
Func PENetwork()
;============安装PENetwork网络控制器===========================
TrayTip("恒信提示", "正在安装 PENetwork网络控制器 ...", 5,1)
If @OSArch="X86" >0 Then
RunWait(@ComSpec & ' /c '&$pl&"\Tools\7-zip\7z.exe x "& $z &":\DLC\TOOL\PENetwork_0.59.4_x86.7z"""" -y -aos -o"&$pl&"\EXTOOLS","",@SW_HIDE)
EndIf
If  @OSArch="X64" >0 Then
RunWait(@ComSpec & ' /c '&$pl&"\Tools\7-zip\7z.exe x "& $z &":\PENetwork_0.59.4_x64.7z"""" -y -aos -o"&$pl&"\EXTOOLS","",@SW_HIDE)
EndIf
Sleep(1500)
FileInstall("PENetwork.ico",$pl & "\EXTOOLS\PENetwork\PENetwork.ico",1 )
FileCreateShortcut($pl & "\EXTOOLS\PENetwork\PENetwork.exe",$pl & "\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\网络工具\PENetwork 网络设置.lnk",$pl & "\EXTOOLS\PENetwork","","",$pl & "\EXTOOLS\PENetwork\PENetwork.ico","",0)
FileCreateShortcut($pl & "\EXTOOLS\PENetwork\PENetwork.exe",$pl & "\Users\Default\Desktop\PE网络管理.lnk",$pl & "\EXTOOLS\PENetwork","","",$pl & "\EXTOOLS\PENetwork\PENetwork.ico","",0)
EndFunc   ;==>PENetwork
;//////////////////////////////////////////////////////////////////////////
if $NET="1" and $PENetwork="1" and $OPERA="1" Then
TrayTip("恒信提示", "安装完成正在退出! ...", 5,1)
Sleep(1500)
Run(@ComSpec&' /c ping 127.0.0.1 -n 1&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
EndIf
if $NET="1" and $PENetwork="1" Then
TrayTip("恒信提示", "安装完成正在退出! ...", 5,1)
Sleep(1500)
Run(@ComSpec&' /c ping 127.0.0.1 -n 1&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
EndIf
If $NET="1" and $OPERA="1" Then
TrayTip("恒信提示", "安装完成正在退出! ...", 5,1)
Sleep(1500)
Run(@ComSpec&' /c ping 127.0.0.1 -n 1&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
EndIf







2#
发表于 2020-6-5 08:59:44 | 只看该作者
好像不是多线程?

点评

AU3不支持多线程吧。。。  详情 回复 发表于 2020-6-5 17:57
技术不行,不会用多线程哦!  详情 回复 发表于 2020-6-5 10:11
回复

使用道具 举报

3#
 楼主| 发表于 2020-6-5 10:11:54 | 只看该作者
caocaofff 发表于 2020-6-5 08:59
好像不是多线程?

技术不行,不会用多线程哦!
回复

使用道具 举报

4#
发表于 2020-6-5 17:57:46 | 只看该作者
caocaofff 发表于 2020-6-5 08:59
好像不是多线程?

AU3不支持多线程吧。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-11-24 23:29

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表