Solved

Batch File to move and copy and compress a file

Posted on 2016-08-12
7
29 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
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 23

Expert Comment

by:NVIT
ID: 41754292
Code?
0
 
LVL 95

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 51

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 51

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 23

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now