Not able to Extract .7z file from c++ program

Dear Everyone,

I have written one program which get all the .7z files from one folder and extract it
but this is not happening

when i run this command using c++ i will get this output

7za x /logs/isac/collation/data/server1/AEPLWEB2-Server - Copy_H20120806-000000175.log.7z
Error:
Incorrect command line

when i run this manually from command line

$ 7za x /logs/isac/collation/data/server1/AEPLWEB2-Server\ -\ Copy_H20120806-000000175.log.7z


Processing archive: AEPLWEB2-Server - Copy_H20120806-000000175.log.7z

Extracting AEPLWEB2-Server - Copy_H20120806-000000175.log

Everything is Ok

I m not understanding what is the problem.

Note: When run manually file name comes like
AEPLWEB2-Server\ -\ Copy_H20120806-000000175.log.7z
and when i run throw c++ program it comes like
AEPLWEB2-Server - Copy_H20120806-000000175.log.7z

I don't know whats happening here.
Use this command line:
7za x "/logs/isac/collation/data/server1/AEPLWEB2-Server - Copy_H20120806-000000175.log.7z"
Hello modoran,

I want to do using c++ program and i solved this problem by putting \" at the beaning and end of the command.

sprintf(cmd,"7za x \"/logs/isac/collation/data/%s/%s\"",fromserver,zippedfile);
system(cmd);
Yes, that's needed because double quotes needs to be escaped to keep the compiler happy.
Topic archived. No new replies allowed.