Turning on a special program at special time and turning off the computer at another special time

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.
thanks every body.

My operating system is Windows7 but if it can be potable , it’s very
good!.

That sounds like a program a special program a terrorist would write.
Are
you a special terrorist? Why the overuse of the word special.

On Wed, Sep 21, 2011 at 9:01 AM, andrew mcelroy [email protected]
wrote:

That sounds like a program a special program a terrorist would write. Are
you a special terrorist? Why the overuse of the word special.

Whoa. Inappropriate.

Ben

On Wed, Sep 21, 2011 at 2:00 PM, amir e. [email protected] wrote:

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

Robert K. wrote in post #1023099:


Kind regards

robert

Thanks robert but I want to write a RUBY program that do it.

Here how i think it should be:

  1. The code needs to be run from windows 7 scheduled tasks at a specific
    time.

  2. The code will be multi-threaded so it can run external commands using
    exec or something similar.

  3. Check the external program you want to run it from ruby, can you
    control it by passing commands to it ? eg: bittorent -x -h

  4. The ruby code checks the current time to a predefined “shutdown”
    time-value, if they match it can shut down the computer by running an
    external task eg: “shutdown”

Thats all i guess.

On Wed, Sep 21, 2011 at 8:20 AM, Ben B. [email protected]
wrote:

On Wed, Sep 21, 2011 at 9:01 AM, andrew mcelroy [email protected] wrote:

That sounds like a program a special program a terrorist would write. Are
you a special terrorist? Why the overuse of the word special.

Clearly not serious here… just saying.

Whoa. Inappropriate.
poe’s law strikes again.

Andrew McElroy.

On Sep 21, 2011 5:27 PM, “amir e.” [email protected] wrote:

Andrew Mcelroy wrote in post #1023092:

That sounds like a program a special program a terrorist would write.
Are
you a special terrorist? Why the overuse of the word special.

Hey " Andrew Mcelroy "
If you don’t have any thing to do , I think you aren’t forced , come to
this site and write your rancid bullshit so please shut your filth mouth
and go away from this site and never come back.

Im sorry you were offended.
Ill be sure to include sarcasm tags in the future.

Andrew

I just have to comment on this one…

I’m new here, and new to programming. I happened to find ruby once
night
while studying and researching programming languages.
And also because an old employer of mine is using the Ruby programming
language.

I am learning a lot from all the posts. I believe we are all trying to
learn
from each other.
I have found Andrew’s comment absurd and out of line. I am hoping this
is
not a common occurrence.
So far I have not seen any comments like this one.

Andrew - I know I probably cannot change your mind or make you think
differently however here it goes…
just because someone’s name looks like Muslim does not mean that they
are
Muslim.
There are many people who do not go by their Muslim name, So you might
not
even know you are speaking to a Muslim.
And there are many people who live in Arab countries who are not Muslim
but
have Arab names because that’s where they live.

On Sep 22, 2011 12:49 AM, “cathy alomari” [email protected] wrote:

I just have to comment on this one…

I’m new here, and new to programming. I happened to find ruby once night
while studying and researching programming languages.
And also because an old employer of mine is using the Ruby programming
language.

I am learning a lot from all the posts. I believe we are all trying to
learn
from each other.
I have found Andrew’s comment absurd and out of line. I am hoping this is
not a common occurrence.
So far I have not seen any comments like this one.

Andrew - I know I probably cannot change your mind or make you think
differently however here it goes…
just because someone’s name looks like Muslim does not mean that they are
Muslim.

It was a bad joke in poor taste.
I was being hyperbolic.
Btw there have been plenty of non Muslim terrorists. Look at Timmothy
mcvey
in the 90s.

Clearly just a white guy.

I wasn’t paying any attention to the name when I made that joke. Asking
how
to start and stop bit torrent sounded like malware code the way it was
asked.

The name had absolutely nothing to do with the joke. Period.

Can we all please get over the butt hurt?
I already said I’m sorry.

Andrew

There are many people who do not go by their Muslim name, So you might not
even know you are speaking to a Muslim.
And there are many people who live in Arab countries who are not Muslim
but
have Arab names because that’s where they live.

On Wed, Sep 21, 2011 at 6:01 AM, andrew mcelroy [email protected]
wrote:

That sounds like a program a special program a terrorist would write.
Are

you a special terrorist? Why the overuse of the word special.
On Sep 21, 2011 7:01 AM, “amir e.” [email protected] 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.

Andrew Mcelroy wrote in post #1023092:

That sounds like a program a special program a terrorist would write.
Are
you a special terrorist? Why the overuse of the word special.

Hey " Andrew Mcelroy "
If you don’t have any thing to do , I think you aren’t forced , come to
this site and write your rancid bullshit so please shut your filth mouth
and go away from this site and never come back.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs