my service downloads an update, writes batch file and executes it by system() call. batch file stops the service, updates it and starts it back. everything works fine when I’m logged in as administrator. under regular user I receive “access denied” to stop service.
I hoped batch file will be run under system account because is lauched by a service. But seems it isn’t. Please explain why not. Any workaround?
You could diagnose the problem by using the
runascommand from a terminal:and also the
icaclscommand to query and set the permissions:and look for the RX permission