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

All I can say is that the code is running fine for me. I am working with admin rights. You should try to login as administrator and see what happens.

Update
ZlR comment is reasonable, the space could be the problem, so you could escape the path like so:
#!/usr/bin/perl -w use strict; my $prog = "\"c:\\program files\\agent\\agent.bat\""; system($prog);

Replies are listed 'Best First'.
Re^2: system command can't spawn cmd.exe
by ZlR (Chaplain) on Jan 12, 2005 at 15:57 UTC
    Hi holli ,

    I don't think this will work, in fact i just tested and it doesn't work !
    Protecting the command itself with quotes doesn't protects from the space, at least in my shell.

    zlr

      I've found protecting it with single quotes instead of double quotes often works. Something like:

      $file=File::Spec->catfile('c:','path',with spaces',to','file'); $file="\'$file\'";