Re: Using Exec on windows
| From: | David | Date: | Sun, 30 Dec 2001 00:35:08 +0000 |
| Subject: | Re: Using Exec on windows | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11210@lists.php.net to get a copy of this message | ||
Hi,
Thanks for your responce!
I've tried passthru(), shell_exec(), backticks and system().
Using shell_exec() I can get out output, when I "End task" on the winzip
program in the background.
All I get is the first 2 lines that Winzip outputs.
When I don't use any parameters, it seems to work fine, just print out the
"Copyright" message.
The command I am trying to execute is similar to this:
c:\\progra~1\\winzip\\winzzip -apr c:\\nameofzip.zip c:\\foldertozip\\
If I "echo" the command and cut n paste it to the "Run" box in windows it
will work fine.
It does not require any input, so it should not be waiting for that.
Any other ideas?
Thanks!,
David
Laserjetter said something on 30 Dec 2001, in php.windows:
> WinZip will need parameters to run from the command line for example to
> tell it what file to unzip. Did you include these in the command
> string? WinZip might be waiting for you to press a key or enter some
> information. It might not be able to find files because the dos window
> could open at any folder. Did you use absolute path names like
> c:\winzip\folder (not ..\winzip)?
> Try using the other executing commands, I think passthru() might work.
>
> LJ
> "David" <php@warpedweb.net> wrote in message
> news:Xns9186C588B368Dphpwarpedwebnet@216.92.131.4...
>> Hi,
>> I'm trying to execute a command line program using exec.
>> I am tring to run a command line interface of Winzip, simpily by
>> executing a string which works when it is typed into the command line.
>>
>> However, PHP just hangs there, I can see the program running the the
>> background, but it does not do anything.
>>
>> When it is run from the command line it takes about 2 seconds to run,
>> but using exec, it will never finish...
>>
>> Does anyone have any idea with this problem?
>>
>> Regards,
>> David
>
>
>