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

Re: Win32::Process::Create fails when i use ">" to redirect the screen output to a file

by prayaspatel (Initiate)
on Aug 28, 2012 at 16:16 UTC ( #990273=note: print w/ replies, xml ) Need Help??


in reply to Win32::Process::Create fails when i use ">" to redirect the screen output to a file

i am using tool.exe but i just mentioned notepad.exe to give as an example. sorry about that. when i only put tool.exe without putting "> log.txt 2>&1" in Win32::Process::Create() it works fine. Also, i can run "tool.exe > log.txt 2>&1" directly from commandline but when i try to use it using Win32::Process::Create() its giving those errors that i mentioned in my initial question.


Comment on Re: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
Re^2: Win32::Process::Create fails when i use ">" to redirect the screen output to a file
by Anonymous Monk on Aug 28, 2012 at 18:19 UTC

    tool.exe is not a shell, it isn't processing "> log.txt 2>&1" so stop giving it that, it doesn't know what to do with that information

    The program you want to call is cmd.exe, read more at  help cmd and Win32::Process redirect CMD output to text file

      its working when i use "cmd.exe" and provide " too.exe -h" as commandline but the problem is when i want to kill it its killing cmd.exe....but actully i wanted to kill tool.exe

        Which is the same problem in the other thread which is unsolved. Perhaps use Win32::Process::List to get the process id to kill and then do Win32::Process::Open on that PID, and kill it that way.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2014-08-22 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (159 votes), past polls