On Wed, Sep 21, 2011 at 2:00 PM, amir e. <aef1370 / gmail.com> wrote:
> I decided to write a program in RUBY wherein these items have been done
> :
>
> 1 - this program must at special time ( for example 1pm ) run a special
> program ( for example utorrent ). 2 - this program at another special
> time must turning off my computer.
>
> I don't any idea about the algorithm and manner of writing such program.
> please help me to write this program.
>  ¨ֲטבמכוצועגןהש>
>
> **My operating system is Windows7 but if it can be potable , it's very
> good!.**

On Windows I would write a simple shell script and schedule it via
"scheduled tasks".  You can shutdown the computer via command line
program "shutdown".

C:\>shutdown /?
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t
xx] [-c "comment"] [-d up:xx:yy]

        No args                 Display this message (same as -?)
        -i                      Display GUI interface, must be the first option
        -l                      Log off (cannot be used with -m option)
        -s                      Shutdown the computer
        -r                      Shutdown and restart the computer
        -a                      Abort a system shutdown
        -m \\computername       Remote computer to shutdown/restart/abort
        -t xx                   Set timeout for shutdown to xx seconds
        -c "comment"            Shutdown comment (maximum of 127 characters)
        -f                      Forces running applications to close
without warning
        -d [u][p]:xx:yy         The reason code for the shutdown
                                u is the user code
                                p is a planned shutdown code
                                xx is the major reason code (positive
integer less than 256)
                                yy is the minor reason code (positive
integer less than 65536)

C:\>

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/