Are there any recommended alternatives to using batch files for performing system actions like shutdown in a PHP web application?

Using batch files for system actions like shutdown in a PHP web application can pose security risks and may not be the most efficient or reliable method. A recommended alternative is to use PHP's built-in functions like `exec()` or `shell_exec()` to directly execute system commands without the need for external batch files.

<?php
// Perform system shutdown using PHP's exec() function
exec('shutdown -s -t 0');
?>