Solved

How to set ip when bootup

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
Employees depend heavily on their PCs, and new threats like ransomware make it even more critical to protect their important data.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

776 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