Welcome Guest.   Make a donation to an author on the site October 23, 2014, 01:00:52 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the Practical Guide to DonationCoder.com Forum Search Features
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Timer to run app at random time within a given period each day  (Read 12189 times)
jovejupiter
Charter Member
***
Posts: 27

View Profile Give some DonationCredits to this forum member
« on: November 24, 2005, 03:13:04 AM »

Hi,

This is the first time I've used this forum (recommended by a Lockergnome forum user), so here goes.....

I'm looking for a way to run a program at a random time within a given period each day. I've searched the web but I can't find anything suitable

The user would supply the time of the start of the period, the time of the end of the period and the path/name of the program to rum.
So for example, if the start time was 1am and the end time was 5am, the "timer" software would run the given programme once a day, at some random time between 1 and 5am, with the time that the program runs being different each day

It doesn't need a fancy interface - just a functional program which isn't user hostile.

Also, the definition of "random" is fairly loose. I gather that Excel uses a formula like
random_number=fractional part of (9821 * r + 0.211327),
where r = the previous random number
The results of this are random enough for most everyday purposes.

Any programmers feel like taking up the idea?

Thanks in advance

Tony
« Last Edit: March 31, 2006, 08:24:05 AM by brotherS » Logged
mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: November 25, 2005, 06:52:53 AM »

i really like this idea - hopefully skrommel will see it and come up with something.
Logged
PhilKC
Charter Member
***
Posts: 117



View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: November 27, 2005, 08:19:06 AM »

Ok, done the app, just need to make a GUI that can actually be used smiley
Logged

It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:
jovejupiter
Charter Member
***
Posts: 27

View Profile Give some DonationCredits to this forum member
« Reply #3 on: November 27, 2005, 12:22:26 PM »

Thanks PhilKC,
I'll look forward to seeing the result
Cheers
-Tony
Logged
PhilKC
Charter Member
***
Posts: 117



View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: November 27, 2005, 03:59:47 PM »

Done!
http://tanyvska.co.uk/DC  ('Till I get my space here sorted out smiley)
Yours is the 'RRunner.exe and .jpg'
Bugs? Suggestions? Shout them out smiley
You will need the latest .NET 2 framework (Use windows update if you don't already)
Logged

It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:
mouser
First Author
Administrator
*****
Posts: 33,578



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: November 28, 2005, 12:44:38 PM »

by the way here is the download for MS .NET2 runtimes:
http://www.microsoft.com/...5e04f5&DisplayLang=en

these could be useful for other programs so definitely worth installing.
Logged
jovejupiter
Charter Member
***
Posts: 27

View Profile Give some DonationCredits to this forum member
« Reply #6 on: November 28, 2005, 02:12:34 PM »

Thanks Mouser,
Microsoft don't exactly make it easy to find.
Logged
jovejupiter
Charter Member
***
Posts: 27

View Profile Give some DonationCredits to this forum member
« Reply #7 on: November 28, 2005, 03:09:36 PM »

Hi PhilKC,

I've installed the program and tried it briefly with a short time period. It seems to work very well so far. I'll try it over the next few days and let you know how things go.

I have a few questions and observations:

I can run more than one copy of the timer simultaneously, to run different programs or the same program more than once, but are there likely to be any problems or conflicts if I do this?

I've set up my computer to switch itself on using the BIOS timer and switch itself off using a shutdown utility. Inbetween it runs various calculation, download and housekeeping tasks under timer control. I'd like to get RRunner to load from the startup group minimised to the system tray, ready to run it's program at some random time. However, RRunner doesn't seem to save the details of the time period and application.
Could the program be made to read a configuration file containg the time period and application path-name (ideally plain text) by using a switch after the program name. That way I could get RRunner to load and run completely automatically or get two instances of RRunner to run different programs at random times automatically.
Also if I set the program to run minimised it minimises to the task bar as well as the system tray. Could the program be set up to (optionally) run already minimised to the system tray?

Does leaving the programme running use up many system resources?

Cheers

Tony
Logged
PhilKC
Charter Member
***
Posts: 117



View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: November 28, 2005, 03:20:15 PM »

I can run more than one copy of the timer simultaneously, to run different programs or the same program more than once, but are there likely to be any problems or conflicts if I do this?

Nope smiley

I've set up my computer to switch itself on using the BIOS timer and switch itself off using a shutdown utility. Inbetween it runs various calculation, download and housekeeping tasks under timer control. I'd like to get RRunner to load from the startup group minimised to the system tray, ready to run it's program at some random time. However, RRunner doesn't seem to save the details of the time period and application.
Could the program be made to read a configuration file containg the time period and application path-name (ideally plain text) by using a switch after the program name. That way I could get RRunner to load and run completely automatically or get two instances of RRunner to run different programs at random times automatically.
Also if I set the program to run minimised it minimises to the task bar as well as the system tray. Could the program be set up to (optionally) run already minimised to the system tray?

I'll work that in soon, something like:    RRunner /m -sh:12 -sm:30 -eh:13 -em:45 -ap:C:\Program Files\Azureus\Azureus.exe
Would: Start minimised, the start range would be 12:30 - 13:45 and the program, Azureus smiley

Does leaving the programme running use up many system resources?

Minimal, It's Visual C++ .NET, it may appear to use chunks of memory, but, this is due to the way .NET handles memory smiley

Glad you're happy with it so far cheesy

PhilKC
Logged

It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:
jovejupiter
Charter Member
***
Posts: 27

View Profile Give some DonationCredits to this forum member
« Reply #9 on: November 28, 2005, 03:26:19 PM »

Hi PhilKC,

Your suggestion for start up settings would be fine - I'll look forward to seeing version 1.1

Cheers

Tony
Logged
PhilKC
Charter Member
***
Posts: 117



View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: November 28, 2005, 04:57:51 PM »

Done! Complicated syntax, but, that's what the GUI is for, right?


RRunner 1 12 30 13 45 C:\hello.exe

Means:
1 == Start silently (0 for normal)
12 == Start Hour
30 == Start Minute
13 == End Hour
45 == End Minute
C:\hello.exe == Application Path

If you use one, you need to use them all smiley

Have fun, go grab 1.1 from http://tanyvska.co.uk/DC

PhilKC
Logged

It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:
jovejupiter
Charter Member
***
Posts: 27

View Profile Give some DonationCredits to this forum member
« Reply #11 on: November 29, 2005, 02:32:50 AM »

Thanks,

I'll try it out over the next few days with a macro that saves a file as part of the process. That way I can use the timestamps to see what times it runs the program.

Cheers

Tony
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.031s | Server load: 0.07 ]