473,394 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

create a program to run another sheduled program


Hello All,
I need to run one program from another within time slots specified by
the user. Could some one please tell me how this could be achieved?
The program that should be run is created in C#, I would prefer to make
the other one also in C# please help me with this!!1
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
6 2106
check out the windows 'Task Scheduler Service' it is free and installed on
all XP machines I believe.
It can be access from the Start Menu -> All Programs -> System Tools ->
Scheduled Tasks.

You can configure it to run your C# program periodically.

HTH

Ollie Riches
"Eranga" <km***@yahoo.com> wrote in message
news:O9*************@TK2MSFTNGP14.phx.gbl...

Hello All,
I need to run one program from another within time slots specified by
the user. Could some one please tell me how this could be achieved?
The program that should be run is created in C#, I would prefer to make
the other one also in C# please help me with this!!1
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2
Hello

One of the simplest methods is to use Timer.

--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"Eranga" <km***@yahoo.com> wrote in message
news:O9*************@TK2MSFTNGP14.phx.gbl...

Hello All,
I need to run one program from another within time slots specified by
the user. Could some one please tell me how this could be achieved?
The program that should be run is created in C#, I would prefer to make
the other one also in C# please help me with this!!1
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #3

Thanks for this idea.I checked it.
But my program's start time and time slot is not fixed through a GUI the
user can change it. So if I use windows sheduled tasks facility I won't
be able to adoptive? Isn't this so?
Also could you please tell me how can I can configure it to run the C#
program periodically?
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #4
you use the wizard in the menu, it allows to specify a date\time and allows
the user to change it

Ollie Riches

"Eranga" <km***@yahoo.com> wrote in message
news:Ow****************@TK2MSFTNGP10.phx.gbl...

Thanks for this idea.I checked it.
But my program's start time and time slot is not fixed through a GUI the
user can change it. So if I use windows sheduled tasks facility I won't
be able to adoptive? Isn't this so?
Also could you please tell me how can I can configure it to run the C#
program periodically?
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #5
hi
i think that you have to use the "Process" class from your program to run
the second one.
you have to use also a timer to run it periodically.
you can find the "Process" class under the "System.Diagnostics" namespace.
hope this will help
El-Sayed Mohamed

Nov 17 '05 #6
Hi,
Here is a piece of code that does that, I use the config file to store the
app path, args and interval

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
private void Form1_Load(object sender, System.EventArgs e)

{

//setup the timer

int interval = Convert.ToInt32(
System.Configuration.ConfigurationSettings.AppSett ings["Interval"]) *

1000 *

(
System.Configuration.ConfigurationSettings.AppSett ings["MinutesORSeconds"].ToLower()=="m"?60:1
);

this.timer1.Interval = interval;

this.timer1.Tick+=new EventHandler(timer1_Tick);

timer1.Enabled = true;

timer1_Tick( null, null);
}

private void timer1_Tick(object sender, EventArgs e)

{

timer1.Stop();

//Restart the process

ProcessStartInfo si = new ProcessStartInfo();

si.FileName =
System.Configuration.ConfigurationSettings.AppSett ings["path_to_exe"] ;

si.WindowStyle = ProcessWindowStyle.Hidden;

//Set the other parameter

if ( this.currentIndex == this.list.Count )

currentIndex = 0;

si.Arguments =
System.Configuration.ConfigurationSettings.AppSett ings["args_to_exe"]+ " " +
list[currentIndex].ToString();

currentIndex++;

theRunningProcess = Process.Start( si );

timer1.Start();

}
"Eranga" <km***@yahoo.com> wrote in message
news:O9*************@TK2MSFTNGP14.phx.gbl...

Hello All,
I need to run one program from another within time slots specified by
the user. Could some one please tell me how this could be achieved?
The program that should be run is created in C#, I would prefer to make
the other one also in C# please help me with this!!1
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eranga | last post by:
How can I write a sheduled thread in C#. Can you please point out to me any good artticles on this? *** Sent via Developersdex http://www.developersdex.com ***
1
by: Filips Benoit | last post by:
Dear All, Unable to run an access2K adp with sheduled tasks win2000. I set i daily at 10:00 but no action !!! I use a bat-file that does the task perfect when i open it manualy. What am i...
2
by: Demonheart0069 | last post by:
HI I had made a script for taking the backup of MYSQL with currentdate and also copy some folder using xcopy The server can only be accesed through remote login(mstsc) the issue is the script...
1
by: nestle | last post by:
I know how to create a file, by using F=fopen("name of file with extension","w"); , where F is a pointer to the file. But how do I create a folder? Do folders have some kind of special format? Please...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.