This is the followup to the sysprep.ini file I recently posted. You can think of this as the postinstall.bat file it refers to. This will prompt for IP address settings and then set them. I could also be used for copying down and installing other applications. The way this is written it assumes that DHCP is running after a reboot. You could cut the IP address settings out if you wanted to have DHCP set instead and just use this to install apps.
@echo off
REM ** Ask for IP address and set it as variable IPADDR
set /p IPADDR= Please enter the new IP address
REM ** Ask for Default Gateway set it as variable DEFGATE
set /p DEFGATE= Please enter the new default gateway
REM ** Ask for subnet mask and set it as variable SUBNET
set /p SUBNET= Please enter the new subnet mask
REM ** ask for Primary DNS and set it to variable DNS1
set /p DNS1= Please enter the new default DNS address:
REM ** ask for secondary DNS and set it to variable DNS2
set /p DNS2= Please enter the new secondary DNS address:
REM *** copy install directory ***
REM *** end copy ***
REM *** change IP address ***
echo setting ip address and subnet Mask
netsh int ip set address name = "Local Area Connection" source = static addr=%IPADDR% mask = %SUBNET%
ECHO setting default gateway
netsh int ip set address name = "Local Area Connection" gateway = %DEFGATE% gwmetric=1
echo setting Primary DNS
netsh int ip set dns name = "Local Area Connection" source = static addr = %dns1%
echo setting secondary DNS
netsh int ip add dns name = "Local ARea Connection" addr = %dns2%
echo here is the new settings
netsh int ip show config
REM *** end ip address set ***
shutdown -r -t 01
No comments:
Post a Comment