• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1940
  • Last Modified:

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 ?
0
mpujari498
Asked:
mpujari498
  • 4
  • 2
1 Solution
 
mpujari498Author 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
 
mpujari498Author 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
 
FishMongerCommented:
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;

Open in new window

0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
mpujari498Author 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
 
mpujari498Author 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
 
FishMongerCommented:
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");

Open in new window


A better option would be to use the Perl modules that I suggested instead of wzzip.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now