Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Help: Windows service

Status
Not open for further replies.

deepsky

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
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
636
Reputation
1,270
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
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.
 

deepsky

Junior Member level 1
Joined
Nov 14, 2003
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
80
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
 

artem

Advanced Member level 4
Joined
May 22, 2003
Messages
1,350
Helped
126
Reputation
252
Reaction score
32
Trophy points
1,328
Location
Turkey
Activity points
13,461
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
 

deepsky

Junior Member level 1
Joined
Nov 14, 2003
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
80
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.
 

artem

Advanced Member level 4
Joined
May 22, 2003
Messages
1,350
Helped
126
Reputation
252
Reaction score
32
Trophy points
1,328
Location
Turkey
Activity points
13,461
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 .
 

umairsiddiqui

Full Member level 2
Joined
Apr 13, 2004
Messages
144
Helped
7
Reputation
14
Reaction score
1
Trophy points
1,298
Location
Sweden
Activity points
1,436
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
http://rapidshare.de/files/7073788/wttss.rar.html
///////////////////////////////////////////////
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
http://rapidshare.de/files/2109151/smileybooks.net__1565926218.rar.html
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???
 

sshahid47

Advanced Member level 4
Joined
Nov 5, 2004
Messages
101
Helped
15
Reputation
30
Reaction score
2
Trophy points
1,298
Activity points
974
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
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top