WinPE Internet Program settings

Source: Internet
Author: User
Tags goto ini

Network Start Server Autoconfiguration Program:

@echo off

PUSHD%~dp0

SET tp=%cd%

Title Hanewin Network start server General purpose free program for winpe_xp_03_win7

REM ========== This behavior starts the boot file, please modify it yourself, must be in the partition root directory =======

Set bootfile=pxegrldr.0

REM ==========================================================

Echo is automatically searching for startup files, it may take some time, please wait a moment ...

Set basedirectory=

Set bootdrver=%~d0

For%%i inch (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 cannot find the gateway file:%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 cannot find the boot file on the%bootdrver% disk:%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= Local Area Connection

>>%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

When REM has multiple network cards, you can remove the following line if you are unsure of the NIC

>>%tp%dhcpsrv.ini Echo. include=%_myip%

>>%tp%dhcpsrv.ini Echo. [Local Connection]

>>%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% Chinese Cabbage Official website

>>%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%% Networking Tools Hanewin network server,%tp%dhcpsrv.cpl,,%tp%dhcp.ico

Pecmd. EXE LINK%%programs%% Network Tools to start the server Hanewin Network start service,%tp%dhcp4nt.exe,-install,shell32.dll#96

Pecmd. EXE LINK%%programs%% Network tool Gateway server shutdown Hanewin Network Restart service,%tp%dhcp4nt.exe,-remove,shell32.dll#95

Pecmd FILE "%%desktop%% Open the Hanewin network server. *"

REM Delete share name Peroot, establish share named Peroot, share resource as%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 has shared the native PE system [Url=file://%computername%peroot]%computername%peroot[/url] to the remote client (hostname:%computername%, username: Guest, Password is empty)

: Windows

Echo.

Echo.

Echo launches the server remotely. Start successfully! Remote network boot is possible 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 Network Server _ Map remote host free program for WinPE

PUSHD%~dp0

Set tp=%cd%

REM Run for the first time

Pecmd.exe IFEX%%desktop%% maps the remote host. lnk,! EXEC cmd/c Copy "%tp% Fast and mapped host. CMD ""%tp% maps the remote host. TMP "

PECMD.exe LINK%%desktop%% Map remote host,%tp% fast and map host. Cmd,,shell32. Dll#17

For%%i inch (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:petoolswin7.ini PECMD.exe file%%desktop%% map far Process Host. *

For%%i inch (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: External program Winpe.ini PECMD.exe file%%desktop%% map Remote Master Machine. *

Pecmd.exe IFEX%%desktop%% maps the remote host. lnk,! EXEC cmd/c Copy "%tp% Fast and mapped host. CMD ""%tp% maps the remote host. TMP "

If exist "%tp% map the remote host. TMP "Goto End

REM Mapping remote Host

Ipconfig/all |find/i "DHCP" |find/i "Server" >%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) does (

Set ip=%%i

)

Set ip=%ip:~1%

ECHO.

ECHO maps the share name Peroot of the remote server%ip% to the local Z: disk, mainly for the client, user Guest, and the password is empty)

ECHO.

ECHO.

ECHO is connecting to the remote server:%ip%, please wait ...

echo.| NET use z: [Url=file://%ip%peroot]%ip%peroot[/url]/user:guest/persistent:no

Pecmd Wait 200

If exist Z:*.* pecmd. EXE MESS Network successfully connected and connected to a remote server for z:nnn if you cannot connect to an Internet network, release-Update the IP in the network settings, or turn off the network boot server on the servers!@ prompt #ok *60000

If exist Z:petoolswin7.ini pecmd. EXE LINK%%desktop%% Load Remote external program 1,pecmd. Exe,load z:petoolswin7.ini,shell32.dll#46

If exist Z: External program Winpe.ini pecmd. EXE LINK%%desktop%% Load Remote external program 2,pecmd. Exe,load z: External program winpe.ini,shell32.dll#46

If not exist Z:*.* pecmd. EXE MESS cannot connect to the remote server, please check the network or server!! @ Hint #ok *60000

: End

Pecmd.exe file "%tp% maps the remote host. TMP "

Pecmd.exe file "%tp% maps the remote host. TMP "

Pecmd.exe IFEX%%desktop%% maps the remote host. lnk,! LINK%%programs%% Network Tools to start the server Hanewin network to start the service side,%tp%hanewin network start service side. Cmd,,%tp%dhcp. ICO

Exit

This source code can be based on their own needs to make appropriate changes.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.