|
我使用的是“我心如水 Server 2003 PE v12.00 网启版”,PXE客户端启动的时候获得IP了,但是在TFTP这个环节出问题了。见下图。
网上查了是因为TFTP权限问题导致不能读取启动文件,请教各位大侠这个问题怎么解决。万分感谢。
还有,下面是我使用的CMD文件。红色的部分是我自己更改的。
@echo off
title WinPE\WINDOWS通用网启服务端
PUSHD %~dp0
SET TP=%CD%
rem ==========以下此行为启动引导文件,请自行修改,启动文件与本cmd同分区即可=======
set bootfile=PXELINUX.0
rem ==========================================================
if not exist %TP%\dhcp4nt.exe echo 当前目录下找不到文件:DHCP4NT.EXE &&pause &&exit
echo 正在自动搜索启动文件,可能需要一些时间,请稍等。。。
set BaseDirectory=
set bootdrver=%~d0
if exist %bootdrver%\%bootfile% set BaseDirectory=%bootdrver%\&&goto copyfile
for /f "usebackq" %%i in (`dir "%bootdrver%\%bootfile%" /s/b`) do set BaseDirectory=%%~dpi
if %BaseDirectory%.==. echo 在 %bootdrver%盘上 找不到启动文件:%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 有多个网卡时,如不能确定那个网卡,可以将下面此行去掉
>>%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%
>>%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 !%%DESKTOP%%\HaneWin网启服务端,%tp%\dhcpsrv.cpl,,%tp%\dhcp.ico
PECMD.EXE LINK !%%Programs%%\网络启动服务器\开启HaneWin网络启动服务端,%tp%\dhcp4nt.exe,-install,shell32.dll#96
PECMD.EXE LINK !%%Programs%%\网络启动服务器\关闭HaneWin网络启动服务端,%tp%\dhcp4nt.exe,-remove,shell32.dll#95
PECMD.EXE LINK !%%Programs%%\网络启动服务器\HaneWin网启服务端,%tp%\dhcpsrv.cpl,,%tp%\dhcp.ico
PECMD FILE "%%DESKTOP%%\开启HaneWin网络启动服务端.*"
PECMD FILE "%%DESKTOP%%\TFTPD32网络启动服务端.*"
echo 删除共享名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 已将本机光盘 %BaseDirectory% 共享给远程客户(\\Winpe\PEROOT,用户名:Guest,密码为空)
:windows
echo.
echo.
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
[ 本帖最后由 pp12416 于 2010-2-2 23:38 编辑 ] |
|