Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: system command can't spawn cmd.exe

by Koosemose (Pilgrim)
on Jan 12, 2005 at 17:32 UTC ( [id://421675]=note: print w/replies, xml ) Need Help??


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

I'm not to sure that's the real problem, If it were they would get an error along the lines of 'c:\program' is not recognized as an internal or external command, operable program or batch file.

For that matter, no matter how I've tried to mangle the path to the bat, I can't get any errors about cmd.exe, I've even emptied everything out of the Path, and all that happened then is, ... well nothing, the script runs but the bat either doesn't run or has no output, but no error. I tried to see if I could generate the error by renaming cmd.exe, but I just got a new one right away.

update: ah here we go, forgot to turn warnings on when testing:
With Path emptied of everything but perl, I get the same error, and just to see if I could match, I ran the script from the same directory and gave it just the name of the .bat, and it ran just fine. So i would have to agree with some of the previous posters in that it's a problem with the the Path environment variable, it apparently doesn't contain the path to cmd.exe. Though I'm not entirely certain why everything runs fine when it's passed just the batch file's name

update: minor reformatting

Just Another Perl Alchemist

Replies are listed 'Best First'.
Re^3: system command can't spawn cmd.exe
by renz (Scribe) on Jan 12, 2005 at 20:28 UTC
    Yeah, I'm not convinced that $prog has anything to do with it. When tested under Win2000 Pro running Activestate's version of Perl 5.8.4, I could not duplicate the issue. Of course, since I have no idea what's in the batch file, I can't say for sure what the problem is.

    But where $prog in test.pl reads:
    my $prog = "c:\\program files\\bwb.bat"; # personal batch file for sundry tasks
    test.pl yields no errors.

    Where $prog in test.pl reads:
    my $prog = "c:\\progra~1\\bwb.bat";
    test.pl yields no errors

    /renz.

    (EDIT: Also, I am working with local admin privs.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://421675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-23 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found