in reply to Re^4: Win32::Process - need help from an expert!
in thread Win32::Process - need help from an expert!

There's no echo program, so that's a very bad test.

Replies are listed 'Best First'.
Re^6: Win32::Process - need help from an expert!
by somuchh8 (Novice) on Sep 13, 2007 at 15:23 UTC
    When I run "helloworld.bat" from the command line it works so that's not true, at least not for me. I have an xserver installed which comes with some unix funtionality ( like ls, echo, etc ). It's called Xvision. So on the command line if I type "echo helloworld" I see "helloworld" on the next line. Can you give me a better test, something that will create a file?
      I just tried 'echo' on a few different machines ( I know that at least one did NOT have an xserver installed ) and they all work like I expect. From the command line if you type "echo hi" you will see "hi" on the next line. It may not be a program but it is still a recognized command on windows, as far as I can tell at least, I may be wrong.

        It'll work from the command line, because the command line can execute more than just programs. DOS has some builtin commands. But we're talking about CreateProcess, which runs programs.

        Just like DOS can't execute Perl commands (e.g. print), Perl can't execute DOS commands (e.g. echo). echo is built in cmd.exe and command.com and not a program, so CreateProcess can't run it. However, just like you can run perl to execute Perl commands (perl -le "print 'Hello World'"), you can run cmd to execute DOS commands (cmd /c "echo Hello World").