in reply to Am I missing something major here (system/exec)?
Since others are helping you on the Web/CGI/HTML front, I'm going to suggest a different tack: You might want to have a scheduled job that runs your batch jobs for you, and make your web interface simply trigger them. The method I use is having my scheduled job simply look for the presence of files in a particular directory. When it sees one, it executes the appropriate script with the trigger file passed in as the argument. (This way your Web app can send in any configuration values to the script--such as the EMail address to send the report to)
This way, you can avoid some of the potential security problems mentioned by ptum and the forking problem mentioned by ww. My favorite reasons for this method, however, are:
Your scheduled job can be as simple as:
Note: I'm typing in the batch file from memory, so consider it untested (and likely incorrect in some details)!REM DOIT.BAT REM REM Note: the .pl scripts are expected to delete their command file D: cd \WORK\QUEUE :LOOP sleep 60 if exists PAUSE_JOB goto LOOP for %%J in (NME\*) do NME_Rpt.pl %%J for %%J in (PURGE\*) do Purge_Old_Files.pl %%J goto LOOP
--roboticus
|
|---|