January 23, 200521 yr I cant believe someone else hasnt asked this before, but I search for 'static IP' and came up with nothing...How does one assign a static IP and network info to a PC UA style?Thanks!
January 23, 200521 yr You should be able to configure it as a part of the WINNT.SIF file. I'm not at all familiar with this particular portion of the file, but here is my best-guess effort at how to set it up. I make no guarantees that this will work.[Networking] InstallDefaultComponents=No[NetAdapters] Adapter1=params.Adapter1[params.Adapter1] INFID=*[NetProtocols] MS_TCPIP=params.MS_TCPIP[params.MS_TCPIP]AdapterSections = params.MS_TCPIP.Adapter1[params.MS_TCPIP.Adapter1] SpecificTo=Adapter1 DHCP=No IPAddress = 1.1.1.1 SubnetMask = 255.255.248.0 DefaultGateway = 2.2.2.2 DNSServerSearchOrder = 193.1.1.3,193.1.1.44 WINS = NoOf course, this code isn't meant to be used as-is, but substitute in the values you want for the dummy IPs that are listed and it should set you up with a nice, shiny static IP.You can easily do this in your winnt.sif - read the helpfile ref.chm"Easy" is relative. I pieced together the above code from the helpfile combined with astalavista's sif that he has posted in another thread. I figure I'm doing well to understand about 1 line in 3.
January 23, 200521 yr In winnt.sif under [params.MS_TCPIP.Adapter1] DHCP=No IPAddress=<enter IP here> SubnetMask=<enter subnet here>
January 23, 200521 yr What about dns servers?Or is that what DNSServerSearchOrder is?I tried it here but for some reason if thats it, its not setting it correctly.
January 23, 200521 yr What about dns servers? DNSServerSearchOrder = 193.1.1.3,193.1.1.44Pretty sure that's what this line is all about.
January 26, 200521 yr i personally use this batch after install (more flexible for different pc's)@echo off:NW_CHOOSEECHO.ECHO 1. STATICECHO 2. DHCPECHO 3. CancelSET /P NW_CONF=[Do you want to use DHCP or specify a static IP? (Select 1 or 2)]IF /I "%NW_CONF%" == "1" GOTO NW_INPUTIF /I "%NW_CONF%" == "2" GOTO NW_SET_DHCPIF /I "%NW_CONF%" == "3" GOTO END:NW_INPUTSET /P STATIC_IP=[iP:]SET /P SUBNET=[subnet Mask:]SET /P GATEWAY=[Default Gateway:]SET /P DNS=[DNS Server:]ECHO.ECHO You specified:ECHO IP Address: %STATIC_IP%ECHO Subnet Mask: %SUBNET%ECHO Default Gateway: %GATEWAY%ECHO DNS Server: %DNS%:NW_CONFIRMECHO.SET /P NW_CONF=[is this correct? Y/N:]IF /I "%NW_CONF%" == "Y" GOTO NW_SET_STATICIF /I "%NW_CONF%" == "N" GOTO NW_INPUTGOTO NW_CONFIRM:NW_SET_STATICnetsh int ip add address "Local Area Connection" %STATIC_IP% %SUBNET%netsh int ip add address "Local Area Connection" gateway=%GATEWAY% gwmetric=1netsh int ip add dns "Local Area Connection" %DNS%GOTO END:NW_SET_DHCPnetsh int ip set add "Local Area Connection" dhcpGOTO END:ENDwill set ip, subnet, gateway and dns.
February 1, 200521 yr no problem, also use this for naming afterwards. i just have both copied to the desktop and run them after full install.@echo off:NW_CHOOSEECHO.SET /P NW_CONF=[Do you want to change the computer name Y/N:]IF /I "%NW_CONF%" == "Y" GOTO NW_INPUTIF /I "%NW_CONF%" == "N" GOTO END:NW_INPUTSET /P NAME=[NAME:]ECHO.ECHO You specified:ECHO NAME: %NAME%:NW_CONFIRMECHO.SET /P NW_CONF=[is this correct? Y/N:]IF /I "%NW_CONF%" == "Y" GOTO NW_SET_NAMEIF /I "%NW_CONF%" == "N" GOTO NW_INPUTGOTO NW_CONFIRM:NW_SET_NAMEcompname.exe /c %NAME%GOTO END:ENDyou will also need the attached file: compname.exe (put in system32 under $oem$ )compname.rar
February 7, 200521 yr :NW_SET_STATICnetsh int ip add address "Local Area Connection" %STATIC_IP% %SUBNET%netsh int ip add address "Local Area Connection" gateway=%GATEWAY% gwmetric=1netsh int ip add dns "Local Area Connection" %DNS%GOTO ENDdnrc, I see your script sets the gateway separately from the ip and mask. I also, noticed that you cannot set them at the same time although the commandline help indicates that you can in one of the examples.I thought I would just point this out in case people didn't just copy your script verbatim and tried to use the example from NETSH.EXE.HTH
February 7, 200521 yr yep that's exactly what i found. the help says you can but it doesn't work so i split it over two lines.
Create an account or sign in to comment