Running an exe from a Windows service before logging on

Hi,

Background:
I am looking into building a Windows service (with which I have very little experience).
The service will need to contain code to:
1. call an external script/exe, ie: "C:\Myprogram\myscript.exe"
2. read (but not write) from the registry.
3. write an update to a log file, ie: "C:\Myprogram\mylog.txt"

My question is:
If the computer is rebooted but nobody logs on and the machine is sitting on the login box (CTRL+ALT+DEL), will my service still be able to perform the 3 tasks above?
It may seem obvious, but I am concerned about how the system will know that my service has permission to read/write files and access the Registry.

Will it "just do it", or do I need to somehow program the service to have administrative permissions?

Many thanks,
GjOK
LVL 2
gjokAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
>>If the computer is rebooted but nobody logs on and the machine is sitting on the login box (CTRL+ALT+DEL), will my
>>service still be able to perform the 3 tasks above?

Yes. Unless you want to read from HKEY_CURRENT_USER, of course.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gjokAuthor Commented:
But how will the system will know that my service has permission to read/write files ?
Does a service (by default) have administrative permissions?
0
jkrCommented:
A service runs under LocalSystem, which has almost Admin privileges, except network access. Writing to local files is not a problem at all.

BTW, be sure to check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndllpro/html/msdn_ntservic.asp ("Creating a Simple Win32 Service in C++")
0
gjokAuthor Commented:
Many thanks for your help.

Regards,
GjOK
0
AxterCommented:
FYI:
If your path is in a mapped drive, your service will have problems access the file(s).
This is the case, even if your mapped drive is mapped to your computer.

As long as you're using the C: drive directy, you shouldn't have any problems.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.