Solved

How to set ip when bootup

Posted on 2003-11-06
5
235 Views
Last Modified: 2010-04-13
Hi,

My PC running in Windows 2000 Server has 2 network card. Somehow, after booting up, the IP address set for both network card is always gone. So I need to manually set it back, thus it is very troublesome for me. Thus I write a script and put in the startup.

@Echo off
Echo Setting IP Address for Interface "LAN"
netsh interface ip set address "LAN" static 192.160.0.160 255.255.255.0
Echo Setting IP Address for Interface "Internet"
netsh interface ip set address "Internet" static 203.120.80.210 255.255.255.240 160.20.90.51
netsh interface ip set dns "Internet" static 160.20.80.80
netsh interface ip add dns "Internet" 160.20.100.80
Echo Setting of IP completed.

However, this will only be activate when I log in.

How can I set the IPs after booting up automatically, because I am planning to schedule for a auto-reboot every morning.

Thanks.
0
Comment
Question by:weiml
5 Comments
 
LVL 5

Expert Comment

by:juliancrawford
ID: 9699478
0
 

Author Comment

by:weiml
ID: 9699509
Hi,

Actually, am I right to say that the "service" is something that is always running in the background? I want a solution whereby it boot up and run once only.
0
 
LVL 5

Expert Comment

by:juliancrawford
ID: 9699545
A service can be started automatically on bootup  - so basically it means your batch file will begin to execute before a user logs in - it will not continually loop on its own code - just once on boot.
0
 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
ID: 9699738
You can simply use the task scheduler as well. Create a new account with administrative rights, use this account to schedule your script to run at "System Startup" (the option might not be displayed while running the wizard; just create the task and then edit it).
Of course, this is only treating the symptoms; is there anything in the event log that might give an idea of what's happening with your IP settings? Was this an upgrade from NT4, what is your service pack level?
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9699759
u can create 2 files for 2 interface.

netsh -c interface1 dump > c:\interface1.txt
for second interface
netsh -c interface2 dump > c:\interface2.txt

now to restore use this.
netsh -f c:\interface1.txt

and u can add both the files into one file called Autoexnt.bat.
Installing the AutoExNT Service

   1. Using a text editor (such as Notepad), create a batch file named Autoexnt.bat and include the commands you want to run at startup in this file.
   2. Copy the Autoexnt.bat file you just created, in addition to the Autoexnt.exe, Servmess.dll, and Instexnt.exe files located in the Resource Kit CD-ROM to the %SystemRoot%\System32 folder on your computer.
   3. At a command prompt, type instexnt install, and then press ENTER.

Configuring the AutoExNT Service to Run at Startup

   1. Click Start, point to Programs, point to Administrative Tools, and then click Computer Management.
   2. Double-click the Services and Applications branch to expand it, and then click Services.
   3. Double-click the AutoExNT service, click Automatic in the Startup type box, and then click OK.

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now