MSFN Forum: temporary network connection - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

If you have questions about customizing Windows XP that are nLite-specific, please post them in the nLite forum, not here. If you have questions regarding the unattended installation of Windows XP, please post them in the Unattended Windows 2000/XP/2003 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

temporary network connection Rate Topic: -----

#1 User is offline   Jay_ro 

  • Group: Members
  • Posts: 4
  • Joined: 05-November 08

Posted 17 November 2008 - 09:25 AM

I have a network at my workplace without DHCP system. Everytime someone comes and needs a network connection I have to manually configure an IP adress and stuff for them. This is not so much trouble, but the thing is that I need to find a way to set that network connection to last only a few hours. Or to last until they restart their computers.
Do you guys know how can I set a computer to use a particular network connection setting only for a limited time? Could a setting like this be created with the help of a batch file?

Thank you


#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 7,349
  • Joined: 28-April 06
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 17 November 2008 - 03:24 PM

I have written a program to static an IP address, which I can share here. Actually its really simple. You can handle this in multiple fashions.

First you can use a Logon script to set the IP address. Use the following procedure:

1. Take 1 machine (a test pc) and put in your IP address info. The whole shot, IP, subnet, gateway, dns, etc.
2. verify connectivity.
3. run the following:

netsh -c interface dump > c:\location1.txt


4. when the computer logs into Windows, run teh following:

netsh -f c:\location1.txt


This, of course, is for specific IP addresses. I use this for computers that always get the same IP, as we have a single drop to a static IP that is assigned to that drop. Now, if you need to assign different IP addresses, you may need another way to create that text file, or create different text files for different users.

You can then use Task Scheduler to create a task that runs every 3 hours (starting from login) that resets the IP information to default. Example command:

netsh interface ip set address "Local Area Connection" dhcp


Obvious issues with this is the name of the connection must be Local Area Connection or the program will fail.

Make sure to also consider the possibility that your users may shut down or power off their computers without logging off them first, which could also trigger a logoff script to 1) delete the scheduled task and 2) reset the NIC to DHCP (redundant but required). As such, you may need to use an INI, or create a file during the logon script. If the file exists at boot (when it shouldn't) the script would need to run the logoff script, and then run the logon script.

My AutoIT code for inputting the static IP (I run from a USB key):

RunWait( @ComSpec & " /c netsh -f " & @ScriptDir & "\location.txt" )
Sleep( 1000 )


Extra info:
http://www.petri.co....ip_from_cmd.htm
http://technet.micro...y/bb490996.aspx

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy