A simple batch job can help you to do such type of maintenance work like starting and shutting AOS Service. Please see the code snippet below:
@SET AOSNAME=Dynamics Server$02-DynamicsAxNTSDev
net stop "%AOSNAME%"
net start "%AOSNAME%"
Note: Replace the AOSName with the AOSService name of your installation.