# Win32 extensions? not OLE

**URL:** <https://www.ruby-forum.com/t/win32-extensions-not-ole/93503>\
**Category:** Ruby\
**Created:** [April 4, 2006, 3:31am UTC](https://www.ruby-forum.com/t/win32-extensions-not-ole/93503 "2006-04-04T03:31:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rain](https://www.ruby-forum.com/u/rain)\
**Post date:** [April 4, 2006, 3:31am UTC](https://www.ruby-forum.com/t/win32-extensions-not-ole/93503/1 "2006-04-04T03:31:39Z")

</div>

Hello  
I’m new to programming and Ruby.  
My question is, "does Ruby have a Windows extensions module that allows  
access to windows OS? "  
Something like the windows extension for Python written by Mark Hammond  
where you can import OS and peform file copies, dir, get OS versions  
ect…

I’m not looking for API or OLE control. Just direct OS control.

---

<div class="post-metadata">

**Author:** ![rain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rain](https://www.ruby-forum.com/u/rain)\
**Post date:** [April 4, 2006, 5:11am UTC](https://www.ruby-forum.com/t/win32-extensions-not-ole/93503/2 "2006-04-04T05:11:28Z")

</div>

Rain wrote:

> Hello  
> I’m new to programming and Ruby.  
> My question is, "does Ruby have a Windows extensions module that allows  
> access to windows OS? "  
> Something like the windows extension for Python written by Mark Hammond  
> where you can import OS and peform file copies, dir, get OS versions  
> ect…
> 
> I’m not looking for API or OLE control. Just direct OS control.

For direct control of Windows, you use the API.

If, however, you want a more abstract, high-level interface to files,  
pathnames, etc., such as Python’s os library provides, you won’t find  
them collected into one module. Check out classes IO, File, FileTest,  
Find, FileUtils, Tempfile, Process, Pathname, and the constant ENV.

If you ask a more specific question about what you want to do, we can  
probably narrow that down for you.

Cheers,  
Dave

---

<div class="post-metadata">

**Author:** ![rain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rain](https://www.ruby-forum.com/u/rain)\
**Post date:** [April 4, 2006, 8:34am UTC](https://www.ruby-forum.com/t/win32-extensions-not-ole/93503/3 "2006-04-04T08:34:26Z")

</div>

If you need platform neutral interface like “file handling”,  
“network socket”, and such, just check out class library bundled  
with Ruby itself. OTOH, if you want certain OS-specific  
features (like “shutting down Windows”, “get OS version”, etc.),  
use “win32ole” module and invoke a call through obtained WMI  
instance. WMI should do the job for most management tasks.

I’ve never heard of any wrapper library that provides simple  
methods to perform common Windows management tasks. You  
probably need to call/use WMI directly through “win32ole” module.  
It’s actually easy and more useful than limited wrapper as  
tons of sample scripts (in VBScript or JavaScript) are floating  
on the net, especially at MSDN site.

> I’m new to programming and Ruby.  
> My question is, "does Ruby have a Windows extensions module that  
> allows access to windows OS? "  
> Something like the windows extension for Python written by Mark  
> Hammond where you can import OS and peform file copies, dir, get  
> OS versions ect…
> 
> I’m not looking for API or OLE control. Just direct OS control.

–  
Taisuke Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), [http://rakugaki.org/](http://rakugaki.org/)  
2268 E9A2 D4F9 014E F11D 1DF7 DCA3 83BC 78E5 CD3A

Message to my public address may not be handled in a timely manner.  
For a direct contact, please use my private address on my namecard.
