Thanks for the reply, but no, I need it for a background program and I need it in a task, not a profile. I want to toggle it based on a location profile.
Maybe there's another way to do what I want.
Calls to it either turn it on if it's off, or turn it off if it's on. This works most of the time.
But when it doesn't work right it's off kilter until I manually check up on it. So I want to build in error checking. Don't try to turn it off unless it's actually already on.