Win32ole


#1

Hello, I am new to Ruby and Windows programming and have a question
regarding the WIN32OLE. The following sample code is used to launch MS
Internet Explorer.

require ‘win32ole’
ie = WIN32OLE.new(‘InternetExplorer.Application’)
ie.visible = true
ie.gohome

What I would like to do is launch MS Windows Explorer (file manager /
Windows GUI Shell) and determine the functions to call to traverse it
(ie expand branches, open files, etc) for automation purposes.

Can anyone suggest resources on how to accomplish this?

Thanks very much!


#2

yeungsprite wrote:

Hello, I am new to Ruby and Windows programming and have a question
regarding the WIN32OLE. The following sample code is used to launch MS
Internet Explorer.

require ‘win32ole’
ie = WIN32OLE.new(‘InternetExplorer.Application’)
ie.visible = true
ie.gohome

What I would like to do is launch MS Windows Explorer (file manager /
Windows GUI Shell) and determine the functions to call to traverse it
(ie expand branches, open files, etc) for automation purposes.

Can anyone suggest resources on how to accomplish this?

Thanks very much!

The Windows Shell object may serve your purpose and is accessible via
COM (win32ole). A simple example:

ws = WIN32OLE.new(“Shell.Application”)
folder = ws.NameSpace(“C:\Temp”)
folder.Items.each do |f|
puts f.Name, f.Type, f.Size
end

Search msdn.microsoft.com for “Scriptable Shell Objects” for more
details.

Mully