Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ Windows MFC Services
Hello, Everybody.
I'm writing a service which runs javascript file with cscript.
I have two apps - client.exe and service.exe. Client sends the service a request to run cscript.exe with parameters.
The javascript file is for installing software - wpkg.js
I tried to create service to run as each type of LocalService, LocalSystem and NetworkService.
Would anyone help me understand LocalSystem's privilleges and what it can do exactly?
I'm concerned about if LocalSystem service can read all of registry keys.

Posted 18-Mar-13 2:57am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

From what Microsoft say[^] it looks like LocalSystem will have all the privilleges and access you will ever need.
However if you can run successfully as LocalService[^] then that may be considered a lower security risk and you may not need to audit every line of your code depending on your customer requirements.
Paul Zheng at 18-Mar-13 8:28am
Hi Matthew, I appreciate your first reply.
But when I tried to read registry key from service, it failed, while reading registry key from ordinary application succeeds. Have you got any idea what could be the cause of this problem?
Matthew Faithfull at 18-Mar-13 8:39am
From the look of things this is going to be a specific issue with a particular Registry Key right not just a total failure to read any Registry Key?
If so then you'll need to examine the error you get back from the access attempt that fails, and you might want to try and retrieve and examine the ACL applicable to the key from the application that can access it. This should at least allow you to work out any privillege you need and don't have.
If you then add the details you've found to your question it will help others to help you.
Paul Zheng at 20-Mar-13 8:51am
Thanks for your recommendation. Here is another question.

If I get environment variable from the service I'm running as LocalSystem account, which varible will be fetched, User Variable or System Variable?
Matthew Faithfull at 20-Mar-13 9:05am
That's a good question and one I don't know the answer to. It should be straight forward enough to find out by experiment. I would expect you'll get the System Variable as LocalSystem isn't a real account but I wouldn't gaurantee it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 650
1 Maciej Los 525
2 Suvendu Shekhar Giri 229
3 Sascha Lefévre 229
4 Richard Deeming 195
0 Sergey Alexandrovich Kryukov 9,693
1 OriginalGriff 9,185
2 Peter Leow 5,112
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 2,876

Advertise | Privacy | Mobile
Web02 | 2.8.150327.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100