Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Batch File to move and copy and compress a file

Posted on 2016-08-12
7
Medium Priority
?
84 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 25

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 59

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
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 

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 59

Accepted Solution

by:
Bill Prew earned 2000 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 25

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

824 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