in reply to system command can't spawn cmd.exe

I haven't worked on PC scripts since NT 4.0, but at that time long file names didn't work at all, you had to use the old style DOS type ones, 8.3 and tilde characters. If this is still the case, the following path may work:

my $prog = "c:\\Progra~1\\agent\\agent.bat";

Kathy A. Graff
http://kgraff.net/