Solved

Batch File to move and copy and compress a file

Posted on 2016-08-12
7
54 Views
Last Modified: 2016-08-12
I just upgraded a pc to windows 10 pro.  The previous pc used a piece of software called pkzip.  my old batch file would call on pkzip.   Is there a way to do this with Windows 10 and the native compression utility.

This is the actual batch file code below that used pkzip.  If anyone could rewrite it with a native compression utility in Windows 10, that would be awesome.  If you can't rewrite it with windows 10.... can you point me to a utility that is free that can provide the same functionality.   This needs to be a very simple process for my user.
0
Comment
Question by:jamesmetcalf74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 24

Expert Comment

by:NVIT
ID: 41754292
Code?
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 41754293
Check out 7zip - it's free and they have a command line utility you can script (you didn't post any code or files).
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 41754295
You didn't include a sample of the code.

My recommendation would be to ge the free utility 7-Zip and we can adjust the code to use it once we see your code.  Should be easy.  It's a well supported product and great for command line usage, Windows doesn't really have the same capability from a BAT script.

http://www.7-zip.org/

~bp
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:jamesmetcalf74
ID: 41754324
sorry
cd mail
REM - This batch file compresses the files needed to send
REM - (notice)
c:\MAIL
@echo off
cd \mail
DEL abW.ZIP
CLS
PKZIP abW.ZIP DEL.FSW
ECHO ********************************************************************
ECHO Finished compressing the file - now it will be tested.
ECHO ********************************************************************
PKUNZIP -T abW.ZIP
ECHO ********************************************************************
ECHO ÿ
PAUSE
0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 41754353
Here's a quick try at a conversion to 7zip, give it a test.  Download and install the software, and then point to the EXE in this file.

cd mail
REM - This batch file compresses the files needed to send
REM - (notice)
c:\MAIL
@echo off
set ZipExe=C:\Program Files\7-Zip\7z.exe
cd \mail
DEL abW.ZIP
CLS
"%ZipExe%" a -tzip "abW.ZIP" "DEL.FSW"
ECHO ********************************************************************
ECHO Finished compressing the file - now it will be tested.
ECHO ********************************************************************
"%ZipExe%" t "abW.zip" "DEL.FSW"
ECHO ********************************************************************
ECHO ÿ
PAUSE

Open in new window

~bp
0
 
LVL 24

Expert Comment

by:NVIT
ID: 41754374
For native compression, i.e. without 3rd party tools like 7-zip or pkzip, you can use Powershell:

Compress-Archive -Path 'c:\MAIL\DEL.FSW' -DestinationPath 'c:\MAIL\abW.ZIP'

Open in new window

0
 

Author Closing Comment

by:jamesmetcalf74
ID: 41754451
Sweet man it works!!!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question