You can use shutdown command to shutdown system. For windows OS, you need to provide full path of shutdown command e.g. Here you can use -s switch to shutdown system, -r switch to restart system and -t switch to specify time delay.