in reply to Re^6: 7zip a folder
in thread 7zip a folder

Have you printed @cmd before running it through system?

If you have done so, you will see that single quotes do not interpolate variables. $forldername appears verbatim in your command.

Most likely, you want to use double quotes instead:

"$foldername/*.log",