幫助中心

當(dāng)前位置:首頁 > 幫助中心 > pe也上網(wǎng)的代碼

pe也上網(wǎng)的代碼

日期:2011-09-07 | 時(shí)間:22:49

 

網(wǎng)啟服務(wù)器自動(dòng)配置程序:

@echo off
PUSHD %~dp0
SET TP=%CD%
Title  HaneWin網(wǎng)啟服務(wù)端 通用免配程序 for winPE_xp_03_win7
rem ==========以下此行為啟動(dòng)引導(dǎo)文件,請(qǐng)自行修改, 必須在分區(qū)(或光盤)根目錄=======
set bootfile=PXEgrldr.0
rem ==========================================================

echo 正在自動(dòng)搜索啟動(dòng)文件,可能需要一些時(shí)間,請(qǐng)稍等。。。
set BaseDirectory=
set  bootdrver=%~d0
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\%bootfile% set bootdrver=%%i:
if not exist %bootdrver%\%bootfile% ECHO 找不到網(wǎng)啟文件:%bootfile% &&pause&& exit
set BaseDirectory=%bootdrver%\
rem if exist %bootdrver%\%bootfile% set BaseDirectory=%bootdrver%\&&goto copyfile
rem for /f "usebackq" %%i in (`dir "%bootdrver%\%bootfile%" /s/b`) do set BaseDirectory=%%~dpi
rem if %BaseDirectory%.==. echo 在 %bootdrver%盤上 找不到啟動(dòng)文件:%bootfile%  &&pause

:copyfile
copy DHCP*.* %temp% /y >nul
set tp=%temp%
%TP%\dhcp4nt.exe -remove >nul
setlocal
set/a a=-2
for /f "usebackq tokens=2 delims=:" %%i in (`ipconfig`) do (
set b=%%i
call :getip
)
for /f "tokens=1-3,4 delims=." %%i in ("%_myip%") do set IP_Pool=%%i.%%j.%%k.100
>%TP%\DHCPsrv.ini echo.[License]
>>%TP%\DHCPsrv.ini echo.Key=BBLZ26803UBBCAT9
>>%TP%\DHCPsrv.ini echo.Name=Free User
>>%TP%\DHCPsrv.ini echo.[DHCPsrv]
>>%TP%\DHCPsrv.ini echo.Profile0=本地連接
>>%TP%\DHCPsrv.ini echo.TFTPDirectory=%BaseDirectory%
>>%TP%\DHCPsrv.ini echo.Multicast=0
>>%TP%\DHCPsrv.ini echo.TFTPEnable=1
>>%TP%\DHCPsrv.ini echo.TFTPPort=69
>>%TP%\DHCPsrv.ini echo.TFTPMode=0
>>%TP%\DHCPsrv.ini echo.Log=0
>>%TP%\DHCPsrv.ini echo.TestIP=1
>>%TP%\DHCPsrv.ini echo.ChangeIP=1
>>%TP%\DHCPsrv.ini echo.EnableMAC=1
rem 有多個(gè)網(wǎng)卡時(shí),如不能確定那個(gè)網(wǎng)卡,可以將下面此行去掉
>>%TP%\DHCPsrv.ini echo.Include=%_myip%
>>%TP%\DHCPsrv.ini echo.[本地連接]
>>%TP%\DHCPsrv.ini echo.SubnetMask=%_mask%
>>%TP%\DHCPsrv.ini echo.BaseIP=%IP_Pool%
>>%TP%\DHCPsrv.ini echo.Range=101
>>%TP%\DHCPsrv.ini echo.BootFile=%bootfile%
>>%TP%\DHCPsrv.ini echo.GatewayIP=%_Gateway%大白菜官網(wǎng)
>>%TP%\DHCPsrv.ini echo.InterfaceIP=%_myip%
endlocal
%tp%\dhcp4nt.exe -install >nul
start %tp%\dhcpsrv.cpl
if not exist x:\*.* goto windows
PECMD.EXE LINK %%Programs%%\網(wǎng)絡(luò)工具\(yùn)網(wǎng)啟服務(wù)器\HaneWin網(wǎng)啟服務(wù)端,%tp%\dhcpsrv.cpl,,%tp%\dhcp.ico
PECMD.EXE LINK %%Programs%%\網(wǎng)絡(luò)工具\(yùn)網(wǎng)啟服務(wù)器\開啟HaneWin網(wǎng)啟服務(wù),%tp%\dhcp4nt.exe,-install,shell32.dll#96
PECMD.EXE LINK %%Programs%%\網(wǎng)絡(luò)工具\(yùn)網(wǎng)啟服務(wù)器\關(guān)閉HaneWin網(wǎng)啟服務(wù),%tp%\dhcp4nt.exe,-remove,shell32.dll#95
PECMD FILE "%%DESKTOP%%\開啟HaneWin網(wǎng)啟服務(wù)端.*"
rem 刪除共享名PEroot,建立共享名為PEROOT,共享資源為%BaseDirectory%
PECMD EXEC CMD /C "net share PEROOT /d"
PECMD EXEC CMD /C "net share PEROOT=%BaseDirectory% /unlimited"
rem PECMD FIND EXPLORER.EXE,KILL EXPLORER.EXE
echo.
echo  已將本機(jī)PE系統(tǒng) [url=file://\\%Computername%\PEROOT]\\%Computername%\PEROOT[/url] 共享給遠(yuǎn)程客戶(主機(jī)名:%Computername%,用戶名:Guest,密碼為空)
:windows
echo.
echo.
echo  遠(yuǎn)程啟動(dòng)網(wǎng)啟服務(wù)器.啟動(dòng)成功!可以進(jìn)行遠(yuǎn)程網(wǎng)絡(luò)啟動(dòng)PE!
echo.
pause
EXIT

:getip
set /a a=%a%+1
if %a%==1 set _myip=%b%
if %a%==2 set _mask=%b%
if %a%==3 set _Gateway=%b%
goto :eof

===================================================================================
@ECHO OFF
Title  HaneWin網(wǎng)啟服務(wù)端_映射遠(yuǎn)程主機(jī) 免配程序 for winPE
PUSHD %~dp0
set tp=%cd%
rem 第一次運(yùn)行
pecmd.exe IFEX %%Desktop%%\映射遠(yuǎn)程主機(jī).LNK,!EXEC cmd /c  copy "%tp%\網(wǎng)啟快捷及映射主機(jī).CMD" "%tp%\映射遠(yuǎn)程主機(jī).TMP"
PECMD.exe LINK %%Desktop%%\映射遠(yuǎn)程主機(jī),%tp%\網(wǎng)啟快捷及映射主機(jī).CMD,,SHELL32.DLL#17
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\PETools\win7.ini PECMD.exe file %%Desktop%%\映射遠(yuǎn)程主機(jī).*
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\外置程序\winPE.ini PECMD.exe file %%Desktop%%\映射遠(yuǎn)程主機(jī).*
pecmd.exe IFEX %%Desktop%%\映射遠(yuǎn)程主機(jī).LNK,!EXEC cmd /c  copy "%tp%\網(wǎng)啟快捷及映射主機(jī).CMD" "%tp%\映射遠(yuǎn)程主機(jī).TMP"
if exist "%tp%\映射遠(yuǎn)程主機(jī).TMP" goto end
rem 映射遠(yuǎn)程主機(jī)
ipconfig /all |find /i "DHCP" |find /i "服務(wù)器">%temp%\ip.txt
ipconfig /all |find /i "DHCP" |find /i "Server">>%temp%\ip.txt
for /f "usebackq tokens=2 delims=:" %%i in (%temp%\ip.txt) do (
set ip=%%i
)
set ip=%ip:~1%
ECHO.
ECHO 將遠(yuǎn)程服務(wù)器%ip%的共享名peroot 映射為本地Z:盤,主要是用于客戶端,用戶Guest,密碼為空)
ECHO .
ECHO .
ECHO 正在連接至遠(yuǎn)程服務(wù)器:%ip%, 請(qǐng)稍等。。。。。。
ECHO.|NET USE z: [url=file://\\%ip%\PEROOT]\\%ip%\PEROOT[/url] /user:guest /persistent:no
pecmd wait 200
if exist z:\*.* PECMD.EXE MESS 網(wǎng)絡(luò)成功連接,并已連接遠(yuǎn)程服務(wù)器為Z:\n\n\n如不能連上InterNet網(wǎng),請(qǐng)?jiān)诰W(wǎng)絡(luò)設(shè)置中釋放-更新絡(luò)IP,或在服務(wù)器上關(guān)閉網(wǎng)絡(luò)啟動(dòng)服端!@提示 #ok *60000
if exist z:\PETOOLS\Win7.INI PECMD.EXE LINK %%Desktop%%\加載遠(yuǎn)程外置程序1,PECMD.EXE,LOAD z:\PETOOLS\Win7.INI,Shell32.dll#46
if exist z:\外置程序\winPE.ini PECMD.EXE LINK %%Desktop%%\加載遠(yuǎn)程外置程序2,PECMD.EXE,LOAD z:\外置程序\winPE.ini,Shell32.dll#46
if not exist z:\*.* PECMD.EXE MESS 無法連接遠(yuǎn)程服務(wù)器,請(qǐng)檢查網(wǎng)絡(luò)或服務(wù)器??!@提示 #ok *60000
:end
pecmd.exe file "%tp%\映射遠(yuǎn)程主機(jī).TMP"
pecmd.exe file "%tp%\映射遠(yuǎn)程主機(jī).TMP"

pecmd.exe IFEX %%Desktop%%\映射遠(yuǎn)程主機(jī).LNK,!LINK %%Programs%%\網(wǎng)絡(luò)工具\(yùn)網(wǎng)啟服務(wù)器\HaneWin網(wǎng)啟服務(wù)端,%tp%\HaneWin網(wǎng)啟服務(wù)端.CMD,,%tp%\DHCP.ICO
exit

(責(zé)任編輯:大白菜官網(wǎng)  eraitsolution.com)

大白菜超級(jí)U盤啟動(dòng)盤制作工具