# Change windows group permissions without the sufficient rights in a batch

I wrote a batch file, which creates multiple folders und subfolders in the current directory. The group permission of one folder is also changed. This works on my local workstation with administrator privileges, but it doesn't work on the server, because I don't have the sufficient rights.

This batch should also be used by other non-administrator users, who don't have the right to change the permissions of folders and it's no option to give them this right.

After reading this comment, the solution seems to be obvious:

1. Write a VBScript, which changes the permission of a given folder (folder-name is the argument)
2. Run the VBScript as Windows Service (run as administrator)
3. And change the batch so, that the Windows Service is called (passing the folder as argument)

My questions are: How can the batch send a command to the windows service? And in what way must the service be implemented, to receive this command and process it?

The sc start command allows you to specify options which will be passed to the service's ServiceMain function.
Make sure you validate the folder name carefully. You don't want someone being able to reset permissions on c:\folders\..\windows\system32, for example.