Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I am newbie to batch file script.I have created simple windows bat file.The problem is bat file run only if the user has admin privilege.But i want to run this batch file for all users like normal users,standard users and guest etc.I have used windows 7.

Access is denied.
[2013-09-18 09:55:07] [error] Unable to open the Service Manager
[2013-09-18 09:55:07] [error] Access is denied.
[2013-09-18 09:55:07] [error] Access is denied.
Access is denied.
Failed to install service

Is possible run windows bat file for all users?

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Tog, Patches, Dave M, Everett Sep 20 '13 at 21:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
What is the error you are getting when running it as a non admin? –  50-3 Sep 18 '13 at 9:51
    
I have added the error message when running it as a non admin –  ILLA Sep 18 '13 at 9:56
    
Check effective permission of user account to the bat and files called, also is this computer on a domain or just a home PC –  50-3 Sep 18 '13 at 10:03
    
what you mean "check effective permission of user account" but my question no need to check user privilege×Comments may only be edited for 5 minutes×Comments may only be edited for 5 minutes×Comments may only be edited for 5 minutes –  ILLA Sep 18 '13 at 10:18
    
Google effective permissions to long for a comment, what is the batch file doing or can you post source? It could be calling a executable that is stopping it? –  50-3 Sep 18 '13 at 10:25

1 Answer 1

Running a batch file with administrative privileges requires your intervention. Running a batch file without is accomplished by default. However, there are several exceptions and possible issues.

Your batch file may include commands that simply fail without elevation, for example writing to the Program Files directory. This is a common issue and the error messages suggest you are experiencing a problem of this kind. Apparently, the batch file either tries to create a service through the service manager, or launches an external program to do this. The batch file does run without administrative privileges, but does not work as intended.

This is normal behaviour. The service manager is largely off limits to normal users. The reason you're getting 'access denied' messages is because access is (correctly) denied. Security settings for access to services can be altered, but I would strongly advise against doing so.

If what your batch file is designed for ought to work without elevation, then rewrite it to avoid using the service manager. If that is somehow infeasable, this question has a ton of information about using services without administrative privileges.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.