Run batch file on XP startup

Posted on 2009-02-12
Last Modified: 2012-05-06
Client has a SBS 2003 server with XP computers. When two people are out a client they run an application that demands that they have static IP address. They can then use a x-over cable to connect the two computers together and share this application. I have created two batch files that each users runs. One batch file assigns and the other to there computers. I have created a third batch file that the user is suppose to run to reset there IP configuration back to DHCP. I have called this batch file BackinOffice.bat
netsh interface ip set address name = "Local Area Connection" source = dhcp
netsh interface ip set dns name = "Local Area Connection" source = dhcp
What seems to be happening is that the users are forgetting to run BackinOffice.bat before they shutdown their computers in field. So when they get back to the office and log in they have no access to any network recourses because our internal IP address scheme is 10.0.0.X.

I would like to have the BackinOffice.bat run on every computer when they boot up in the office automatically. Of course I would not this batch file to run on any of our three servers when they are rebooted. I am think that Group Policies is the best way to accomplish this but unsure of how to do this.

Thanks for your help.
Question by:chris-currell
    LVL 16

    Expert Comment

    please look at item 8 on this list..
    once done.. you could exclude ur servers from being affected by this GPO
    LVL 16

    Expert Comment

    LVL 13

    Expert Comment

    If it is just those 2 users, you could go into TCP/IP properties and set their IP on the 10.0.0.x office network as static, then click the Advanced button and add 192.168.0.x a 2nd IP address to the NIC. Then there should be no extra configuration needed whether they are in or out of the office.
    LVL 21

    Accepted Solution

    One these will do the trick.

    Local machine startup script on the laptop. gpedit.msc
    scheduled tasks to run at startup using SYSTEM account. SCHTASKS CREATE /?
    When the IP is set to DHCP you could set an alternate IP when DHCP is not available it uses the static you assigned. Internet Protocol (TCP/IP) - Properties - Alternate Configuration

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    This article was inspired by a question here at Experts Exchange ( The requirements stated in that question are (1) reduce the file size of a large number of…
    I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 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

    13 Experts available now in Live!

    Get 1:1 Help Now