May not be pretty, but you can always do

username=%x[echo %USERNAME%].strip


A decent sized list of windows environmental variables is here:
http://vlaurie.com/computers2/Articles/environment.htm

That said I think there _is_ s nice builtin way of accessing windows
environmental variables in ruby, but it's been so long I'd probably
just shell out using %x :)

On Fri, Apr 17, 2009 at 11:08 AM, Mmcolli00 Mom <mmc_collins / yahoo.com> wrote:
> Do you know if there is a way to get the Windows OS Login name using
> Ruby? I can do this with VB but haven't found a way to do this in Ruby.
>
> Thanks
> MC
> --
> Posted via http://www.ruby-forum.com/.
>
>