Solved

How to set ip when bootup

Posted on 2003-11-06
5
236 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 83

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

861 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

23 Experts available now in Live!

Get 1:1 Help Now