Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help: Windows service

Status
Not open for further replies.

deepsky

Junior Member level 1
Junior Member level 1
Joined
Nov 14, 2003
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
80
Dear Friends,
I want to run a computational code which requires much CPU time. I decide to run my code on our department’s computers. But it should be run in the background. In fact I want to run my code as a Windows service with low priority so other users can do their tasks easily and my code is running whenever the computer is on and ideal. Anyone can help me?
I think of writing a Windows service to run a simple batch file. What do you suggest :?:

Best Regards,
DeepSky
 

I don't know about running a program as a service, but you could run it from the command-line or batch file like this:
start /low myprogram.exe

To see a list of other options:
start /?

Or maybe you could use the Windows "Scheduled Tasks" feature to run your program or batch file at certain times.
 

echo47 said:
I don't know about running a program as a service, but you could run it from the command-line or batch file like this:
start /low myprogram.exe

Thanks for your reply, now I can run a program with low priority.
but,
I want my program starts when Windows starts up, even before any users log in.
So my code is running automatically in the background, whenever the computer is on.
I guess there would be no problem if I could write a service program to run a batch file.
Please help me,
Thanks
 

there is command called "at" so you can run program at specified time and of course make a recursive call to that command from batch you are trying to run .
Web says - to run program at start up time msconfig can be used .
At same time I have searched my startup list and found it stored at :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
in windows registry. You can try to add your entry here manually - path to executable to be run at windows startup time .
My win is 2K SP4 .

or autoexec.bat of course is the old place for such things
 

artem said:
there is command called "at" so you can run program at specified time and of course make a recursive call to that command from batch you are trying to run .
Web says - to run program at start up time msconfig can be used .
At same time I have searched my startup list and found it stored at :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
in windows registry. You can try to add your entry here manually - path to executable to be run at windows startup time .
My win is 2K SP4 .

or autoexec.bat of course is the old place for such things

If I put my file in HKEY_LOCAL_MACHINE\...\Run then each time every user logs off my program will terminate. also it doesn't run in the background.
 

that one will schedule program and wait in background
at 15:00:00 /interactive program_name.exe

make a recursive call to batch from within batch

Try to look for M$ register definitions to find registry entry to run program before log on is done . I think it should be there, but keep right for mistake .
 

have a look at these books:

Win32 System Services: The Heart of Windows® 98 and Windows® 2000
Marshall Brain
Ron Reeves
Publisher: Prentice Hall PTR
Third Edition December 01, 2000
ISBN: 0-13-022557-6, 720 pages
**broken link removed**
///////////////////////////////////////////////
Windows System Programming Third Edition
By Johnson M. Hart
Publisher : Addison Wesley Professional
Pub Date : October 26, 2004
ISBN : 0-321-25619-0
Pages : 576
http://www.easyfilehost.com/?file=1131662545
pass: ebooksclub.org
////////////////////////////////////////////
Python Programming on Win32
Mark Hammond
Andy Robinson
Publisher: O'Reilly
First Edition January 2000
ISBN: 1-56592-621-8, 672 pages
**broken link removed**
pass: smileybooks.net
/////////////////////////////

note it also possible to use java, perl ofcourse vb and c#

btw a related question: is it possible to create unix deamon processes in cygwin???
 

Hi,
what you are wanting is exactly a windows service program,
this service will start as soon as windows boots up and also you can set the priority by call setprocesspriority,
refer to msdn on how to write service programs and install them using service control manager.

hope that helps
 

yes on msdn u can reach many sources i checked it for ya **broken link removed**
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top