Forum: Ruby Login script

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joey S. (Guest)
on 2006-02-20 04:34
hello!

on windows 2003. id like to use ruby to process my login script.

how do you read all mapped drives, map a drive or disconnect a mapped
drive with ruby?

can someone point me to any documentation with regards to making calls
similar to the above?


thank you so much!

joey
James B. (Guest)
on 2006-02-20 05:29
(Received via mailing list)
joey se wrote:
> hello!
>
> on windows 2003. id like to use ruby to process my login script.
>
> how do you read all mapped drives, map a drive or disconnect a mapped
> drive with ruby?
>


I have  a script to map some drives, with stuff such as:

require 'win32ole'
net = WIN32OLE.new('WScript.Network')
user_name = 'some_user_name'
password = 'top-secret-password'


net.MapNetworkDrive( 'X:', '\\james3480\$C', nil,  user_name, password )


Poke around MSDN for WScript.Network examples using JScript or VBScript.

That's how I worked out what I needed.


--
James B.

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.30secondrule.com   - Building Better Tools
This topic is locked and can not be replied to.