Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

How to set ip when bootup

Posted on 2003-11-06
5
Medium Priority
?
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 85

Accepted Solution

by:
oBdA earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
What monsters are hiding in your child's room? In this article I will share with you a tech horror story that could happen to anyone, along with some tips on how you can prevent it from happening to you.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

649 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