You tried open cmd with elevation privileges? ("run as administrator")? In this situations can be necessary run cmd with elevation privileges.
I hope I heave helped.
Disable the access protection in the Virus Scan console and try to restart the services.
Please remember to re-enable Access Protection after the restarting McAfee services.
Disabling 'Access Protection' and running with elevated privileges should work BUT in my case the whole flow is controlled by batch file not Console. Based on someone response from another thread on this forum it's not possible to disable 'Access Protection' from command line because it would compromise McAfee.
Well the whole reason for that is that I'm using xdat.exe for daily update. After running xdat.exe it requires restart McAfee services in order to take effect.
For now I found a workaround: every time after execution xdat.exe I reboot the system. Well it's not elegant way of restarting McAfee services but it makes effect.
In this case (batch script) You can use "runas" command line to execute xdat.exe, for more details access: Microsoft Corporation.
About Your script, the idea is no interaction with users? If can have interaction You could instruct users for: Righ click on batch file and choose "Run as administrator";
I hope I have helped.
I don't have users scanning any of my PC's. All computers were scanned at the same time using batch script i.e. no human intervention.
To run xdat.exe I don't have to run as administrator ... it could be any user. In order to restart McAfee services command 'runas' or similar elevated admin privilege should be used. This also is not a problem.
The problem is that none of the command would succeed while 'Access protection' is disabled. I didn't find ( and folks say it's not possible ) to disable 'Access protection' from command line hence I can't restart services from command line.
Hence .. I'm restarting PC which does service restart.