views:

159

answers:

1

I'm running the following php code;

$output = exec('"D:\TESTDIR\unrar.exe" e "D:\TESTDIR\Icons.rar" -ppassword');
echo $output;

Which isn't working... I want it to extract the files into the same directory. If I copy the contents of the exec into a command line prompt it works just fine, so slightly confused.

Trying the following;

$output = exec('"D:\TESTDIR\unrar.exe"');
echo $output;

Returns the last line of the unrar help file (which is expected).

+1  A: 

Is it possible to add a destination to the command so you can tell unrar where to place the unpacked files?

Probably PHP now is trying to unpack it in the directory the php file is located.

Jimmy Shelter