Try putting quotes inside the string, around the full path.
my $prog = "c:\\program files\\agent\\agent.bat"; system(qq("$prog"));
The "fix everything" solution is, of course, to use a path without spaces.
In reply to Re: system command can't spawn cmd.exe
by bart
in thread system command can't spawn cmd.exe
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |