in reply to CGI script: How to run batch file in command window?

Far easier and less problematic: Send the output of the java app to a file, and read the file from your desktop.
use IPC::Open3 qw( open3 ); my $log = "..." . get_unique_str() . ".txt"; open(local *TO_CHLD, '<', 'nul') or die; open(local *FR_CHLD, '>', $log) or die; waitpid(open3('<&TO_CHLD', '>&FR_CHLD', undef, @cmd), 0);