Jump to content



Photo

Run apps when laptop connected to mains


  • Please log in to reply
2 replies to this topic

#1 manroweb

manroweb

    Lover of all things tech

  • Tech Issues Solved: 1
  • Joined: 07-April 02
  • Location: Swindon UK

Posted 23 December 2012 - 22:24

I am looking for an app or method to have things run on my laptop when it is connected to the mains.
Does anyone know of any apps which can do this?

Alternatively can I run apps when connected to specific networks?


#2 +BudMan

BudMan

    Neowinian Senior

  • Tech Issues Solved: 100
  • Joined: 04-July 02
  • Location: Schaumburg, IL
  • OS: Win7, Vista, 2k3, 2k8, XP, Linux, FreeBSD, OSX, etc. etc.

Posted 24 December 2012 - 17:13

mains - you mean while plugged into power vs running on battery only?

As to while connected to specific network

Hmmm --- both should be possible with just the built in task scheduler -- just trigger them on an event. Now I don't believe there is event logged for change when plugged in or not plugged in, but it would be simple enough to monitor with a powershell script. Just do a google for monitor batterystatus powershell - simple Write-EventLog in your powershell script could be use to have an event happen when charging, when on battery. So your task could be setup to start your applications when on "mains" and then shut them down on "battery" only.

Same could be said for different events for when you are connected to a specific network, be it SSID based, IP based or some other check you could get from the eventlog, or create in the enventlog via powershell.

#3 OP manroweb

manroweb

    Lover of all things tech

  • Tech Issues Solved: 1
  • Joined: 07-April 02
  • Location: Swindon UK

Posted 27 December 2012 - 09:40

I certainly did mean connected to mains as opposed to running on battery.

Thanks for the pointers I will start to play.