What considerations should be made when calling external programs with shell_exec() in PHP on Windows?

When calling external programs with shell_exec() in PHP on Windows, it is important to consider the security implications. Make sure to sanitize any user input to prevent command injection attacks. Additionally, be mindful of the path to the executable as Windows uses backslashes (\) instead of forward slashes (/) in file paths.

$command = 'C:\\path\\to\\executable.exe argument1 argument2';
$output = shell_exec($command);
echo $output;