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 serviceIs possible run windows bat file for all users?
51 Answer
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.