durex Posted January 23, 2005 Share Posted January 23, 2005 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! Link to comment Share on other sites More sharing options...
<SparTacuS> Posted January 23, 2005 Share Posted January 23, 2005 You can easily do this in your winnt.sif - read the helpfile ref.chm Link to comment Share on other sites More sharing options...
Cartoonite Posted January 23, 2005 Share Posted January 23, 2005 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. Link to comment Share on other sites More sharing options...
Yzöwl Posted January 23, 2005 Share Posted January 23, 2005 In winnt.sif under [params.MS_TCPIP.Adapter1] DHCP=No IPAddress=<enter IP here> SubnetMask=<enter subnet here> Link to comment Share on other sites More sharing options...
durex Posted January 23, 2005 Author Share Posted January 23, 2005 Sweet... didnt even think to look there.Thanks as always gentlemen. Link to comment Share on other sites More sharing options...
war59312 Posted January 23, 2005 Share Posted January 23, 2005 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. Link to comment Share on other sites More sharing options...
Cartoonite Posted January 23, 2005 Share Posted January 23, 2005 What about dns servers? DNSServerSearchOrder = 193.1.1.3,193.1.1.44Pretty sure that's what this line is all about. Link to comment Share on other sites More sharing options...
dnrc Posted January 26, 2005 Share Posted January 26, 2005 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. Link to comment Share on other sites More sharing options...
vAgo Posted January 26, 2005 Share Posted January 26, 2005 thx guy it's a good script!!!!! Link to comment Share on other sites More sharing options...
war59312 Posted January 27, 2005 Share Posted January 27, 2005 Yeah very nice.Thanks a ton, Will Link to comment Share on other sites More sharing options...
dnrc Posted February 1, 2005 Share Posted February 1, 2005 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 Link to comment Share on other sites More sharing options...
Dobby Posted February 7, 2005 Share Posted February 7, 2005 :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 Link to comment Share on other sites More sharing options...
dnrc Posted February 7, 2005 Share Posted February 7, 2005 yep that's exactly what i found. the help says you can but it doesn't work so i split it over two lines. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now