Solved

How to set ip when bootup

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

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…
ConnectWise and their customers need to ensure critical alerts automatically reach the right person at the right time. MSP superheros efficiently respond to these alerts key is providing automatic, intelligent alerting that generates a complete audi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

792 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