# WZZIP is not recognized as internal or external command in perl

Hi..am trying to zip the files in windows server and trying to copy that zip folder from windows server to unix server using this command # system ("wzzip -a c:\\SSTUD\\Wfiles\\ftp\\$file");. It was working fine till last week. This week we moved the files from another windows server and its showing the error ''wzzip' is not recognized as an internal or external command,'. The only difference is in old windows server winzip 11.2 was installed and in the in the new windows server winzip 12.1 is installed. Could you please help on what will be the issue for this ? Asked: ###### Who is Participating? [Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More x I wear a lot of hats... "The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S. Author Commented: Hi..am trying to zip the files in windows server and trying to copy that zip folder from windows server to unix server using this command # system ("wzzip -a c:\\SSTUD\\Wfiles\\ftp\\$file");. It was working fine till last week. This week we moved the files from another windows server and its showing the error ''wzzip' is not recognized as an internal or external command,'. The only difference is in old windows server winzip 11.2 was installed and in the in the new windows server winzip 12.1 is installed. Could you please help on what will be the issue for this ?
0
Author Commented:
Hi this is my code:
# Usage Declares
use POSIX qw(strftime);
use Cwd;
use constant DEBUG => 1;
use constant ONE_DAY => 60*60*24;

my $dt = 0; my$dateadjust = 0;
my $file = ""; # Calculating the datetimestamp:$dt = time() + (ONE_DAY * $dateadjust);$now_string = strftime ("%Y%m%d%H%M%S",localtime($dt)) ;$file = "wsLWXS.$now_string.zip"; chdir "c:\\SSTUD\\Wfiles\\output"; system ("wzzip -a c:\\SSTUD\\Wfiles\\ftp\\$file");
system ("copy c:\\SSTUD\\Wfiles\\ftp\\$filec:\\SSTUD\\wfiles\\archive"); chdir "c:\\SSTUD\\Wfiles\\ftp"; system ("ren$file wsLWXS.zip");

# system (pause 3);

system ("move /Y c:\\SSTUD\\wfiles\\output\\*.*c:\\SSTUD\\wfiles\\archive\\output");

chdir "c:\\SSTUD\\scripts";
system ("studioftp.bat $file"); Please he me onthis? 0 Commented: Is the wzzip executable in your path? Have you tried specifying the full path in the system call? Instead of the system calls, it would be better to use Perl's Archive::Zip and File::Copy modules. Archive::Zip - Provide an interface to ZIP archive files. File::Copy You should also be using the strict and warnings pragmas in every Perl script. use strict; use warnings;  0 Author Commented: Hi , Can you please help me how to verify the wzzip is executable in my path? How to specify the full path in system call? This is bit critical and urgent... Thanks a lot... 0 Author Commented: The script is called through a (TWS)Tivoli Workload scheduler. When i run the script manually from my server, it runs perfectly. But when the TWS triggers the script, it is not able to recognize the wzzip command. 0 Commented: Your TWS process is probably running under a different user account which does not have the same environment settings as your account. One of those settings is the %PATH%. You need to find out where the wzzip executable is located and specify that in the system call. e.g., system ("c:\\path\\to\\wzzip.exe -a c:\\SSTUD\\Wfiles\\ftp\\$file");


A better option would be to use the Perl modules that I suggested instead of wzzip.
0

Experts Exchange Solution brought to you by