Offistart - Virtual Offices, Office Space, Business Support Services
*Home>>>Service Offices

How do I make Windows Vista (Ult) run a command when the DHCP-Client successfully updates my connection info?


Rules
#1: No human interaction
#2: Must work at the welcome screen (not loged in)
#3: Whatever command is run needs to run as a specific user and with elevated privileges

I am trying to restart the service that manages my VPN connection any time I have connect to any network. I use OpenVPN for the VPN connection but every time my computer changes networks OpenVPN fails to reconnect. Currently I fix this by stoping the VPN Service and then starting it again. No biggie right?

Except... the reason my laptop has openvpn is because I want access to the files and services back at the office... all of which (vpn or no vpn) requires me to be logged into my domain account. When my computer turns on... I'm not yet logged in and thus can't restart the service. I COULD log into another account first but I'd rather not. See the problem?

So any way I got a batch file that will restart the service... now I just need to make it run any time I grab an ip.

So, just to be sure I understand what you want; you are trying to set it up to run an aplication or perform and action when your system recives a new IP address via DHCP?

Ok, first order of buisness to to write a quickie script. Start notepad and create something like "svcrstrt.bat" in the root of C:. You need it to contain the following:

net stop <service name>
net start <service name>

and save your work. Go ahead and run the script to verify it works. If it doesnt work then you will need to give it security elevation by right clicking, selecting 'Properties' and in the 'Compatibility' tab, tick off the "Run as an administrator" option. The only downside to this one is that you wll get UAC prompts when the script goes to run.


Now, the rest can be setup with the Task Scheduler. Just open up the Event Viewer and search through the system log for the event you are looking for. You will probably want the Event ID 1103 which originates from DHCP-client. Select the event, and on the Actions pane on the right, select "Attach a Task to this Log..." and follow the Wizard. When it asks for the action to perform, point it to te bat file we made earlier.

There ya go, give it a test.









======EDIT==========
Just read that you already have a BAT file, so you can obviously ignor the first half of my answer.

Tags
  Meeting Room   Meeting Space   Conference Room   Offices to Lease   Rent Offices   Business Centers   Service Offices   Branch Offices   Temporary Offices   Shared Offices   Commercial Space   Office Space
Related information
  • Technical Resume help?

    First thing, resumes are necessarily the most grammatically correct documents. Obviously, you need everything spelled correctly. 1) Change "to improve already established customer base&quo...

  • I need your help fast?

    Hi, I have handed out flyers before and honestly you probably only get 1 customer per 100 flyers, if you're lucky... it is disappointing but if you can get at least one or 2 customers from the...

  • Should I file a formal complaint with the city about the other apartment problems?

    keep a journal of everything: what's gone bad, when it went bad, who who spake to, when you spoke to them, what each of you said, what git fixed, when it got fixed etc. have copies of everyth...

  • I'm having a dispute with my landlord regarding late fees.?

    If the landlord cashed the check, you are not in arrears for your rent payments. If the money order was dated for the usual due date of the rent, the landlord cannot claim that it was late. T...

  • A non-lawyer charging for lawyer services?

    Did you get anything in writing what the charges were to use this service? Did they show you their charges before hand? If this organization is dealing with immigration issues as a non profit then ...

  • Itunes and Open Office Help?

    1. Vista does not normally come with an office suite anyway. iTunes is compatible with both XP and Vista. 2. OpenOffice is just like any other program.It does not require you to remove XP at all...

  • Can my apartment limit me to their ISP and block ports?

    I'm guessing this is a wi-fi connection in your complex. That is outrageous. Can't you just contact you local cable co. and get Internet service? or you local phone co.and get DSL? How...

  • What ever happened to her?

    Here you go ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster