# Windows - how to control XP control panels: network setting

**URL:** <https://www.ruby-forum.com/t/windows-how-to-control-xp-control-panels-network-setting/50591>\
**Category:** Ruby\
**Created:** [December 18, 2005, 7:14pm UTC](https://www.ruby-forum.com/t/windows-how-to-control-xp-control-panels-network-setting/50591 "2005-12-18T19:14:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [December 18, 2005, 7:14pm UTC](https://www.ruby-forum.com/t/windows-how-to-control-xp-control-panels-network-setting/50591/1 "2005-12-18T19:14:03Z")

</div>

I want to write a script to toggle my wireless and wired connections  
ON/OFF.  
Any pointers on how to go about doing this?

Thanks!

---

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [December 18, 2005, 9:05pm UTC](https://www.ruby-forum.com/t/windows-how-to-control-xp-control-panels-network-setting/50591/2 "2005-12-18T21:05:44Z")

</div>

itsme213 wrote:

> I want to write a script to toggle my wireless and wired connections ON/OFF.  
> Any pointers on how to go about doing this?

General routine for Windows system fun:

- Go to MSDN
- Search around for how to do this using VBScript or JScript.
- Port to Ruby, using Win32OLE lib for ActiveX/Win32 calls.

## James

[http://www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[Ruby Code & Style](http://www.artima.com/rubycs/) - Ruby Code & Style: Writers wanted  
[http://www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[http://www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
[http://www.30secondrule.com](http://www.30secondrule.com) - Building Better Tools

---

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [December 18, 2005, 9:38pm UTC](https://www.ruby-forum.com/t/windows-how-to-control-xp-control-panels-network-setting/50591/3 "2005-12-18T21:38:54Z")

</div>

You will likely need to access the Windows API - these posts may help  
you:

[http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=114198&SiteID=1](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=114198&SiteID=1)

> **[Technical documentation](https://learn.microsoft.com/en-us/docs/)**

The second edition of the Pickaxe book has some info on calling the  
Win32API on page 755.

The same example is on the web here:  
[http://www.rubycentral.com/book/lib\_windows.html](http://www.rubycentral.com/book/lib_windows.html)

Les
