Windows batch file to start and stop service for different users
I am having an Admin account that wanted to run a batch file that will start and stop a few services for different users.(Wanted to perform from the same server)
For example, what I wanted to do is CMD run as username password net start service.exe
Can you guide to use the correct formation of the commands
Solution 1:
... start and stop a few services for different users.
That's not how Windows Services work.
You define a Service and, as part of that definition, you set the account that it will run under, usually a system one.
That's it.
You cannot have multiple instances of a Windows Service running under different accounts (well, you could, but each and every Service * User combination would to be installed as its own Service!)
You can run processes (executables) under different accounts, but they would not be Windows Services. As such, "net start" cannot help you.