Click here to Skip to main content
11,922,320 members (39,272 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Windows MFC service
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 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 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 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 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 493
1 Dave Kreskowiak 285
2 Sergey Alexandrovich Kryukov 243
3 Richard MacCutchan 155
4 ppolymorphe 135
0 OriginalGriff 7,231
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,356
3 George Jonsson 2,865
4 Suvendu Shekhar Giri 2,216

Advertise | Privacy | Mobile
Web03 | 2.8.151120.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