I'm trying to automate some processing on a Windows
2000 server. The goal:
Watch a particular directory for batch files to show up.
Rename it to another dir, tacking on a time stamp.
Execute it.
Rename it to a "done" dir.
These batch files call an AFP spooling utility that is
strictly command line / STDIO IO programs, not creating desktop
windows.
I have a master batch file that I use to execute them,
which then does the final rename to the done dir.
I want to execute the master batch file in the background,
redirecting the STDERR and STDOUT to files.
I also want to execute it in the background, returning control
back to my perl script immediately so I can execute any more
that happen to be in the queue. Under Linux I would have used
the perl:
system("FULL_FILE_NAME_TO_EXECUTE 2>stderr.log 1>stdout.log &");
Modifying the logs to reflect the program being executed, of
course.
I orginally did all the by logging in via WinSSHD to the box,
but the WinSSHD has been implicated in some BLue Screens so
I am trying to knock it out of the picture.
If I was trying to do the work "byhand" under Linux I'd
play with fork and STDOUT/STDERR reopening, etc.
But I can't get it to work that way.
Is there some standard Windows untility that does this?
Any hints?