I have been trying to zip files on remote windows server but not getting success by whatever i tried. Below is the small peice of code. Please tell me where m going wrong. This code is not producing any error but just not generating the zip file.
use strict;
use warnings;

# before running check perl module is installed in your PC.

use Archive::Zip;
use File::Basename 'basename';

my @files = ('D:\Scripts\Testing\abc.txt'); # if it is more than one file add it by using comma as separator

my $zip = Archive::Zip->new;

foreach my $file (@files) {
my $member = basename $file;
printf qq{Adding file "%s" as archive member "%s"\n}, $file, $member;
$zip->addFile($file, $member);
printf "Member added\n";
}
printf "Writing to zip\n";
$zip->writeToFileNamed('zippedFolders.zip'); #zip file name change it as u want


Check Solution