From: James Tucker Date: 2008-03-31T21:08:32+09:00 Subject: Re: how to restart the system with our code On 31 Mar 2008, at 12:45, Damjan Rems wrote: > Vamsi Krishna wrote: >> Hi all, >> >> well, i thaught differently and want to know can any body help me >> to >> restart or shutdown an operating system with ruby code? >> if possible please reply, i think it may be possible... > > > system 'any cmd' # comes to mind. win = RUBY_PLATFORM =~ /(ms|cyg)win|mingw/ flags = ' -h now' flags = ' -t 0' if win system "#{'sudo' unless win} shutdown #{flags}" or something like that... > by > TheR > -- > Posted via http://www.ruby-forum.com/. >