Solved

WZZIP from command line question

Posted on 2006-06-21
1
380 Views
Last Modified: 2012-06-22
Hi,

I need to recurse through a directory and zip each file individually keeping the same file name... Ie.

1.TXT  ---> 1.ZIP
2.TXT  ---> 2.ZIP

It seems like I used to use something similiar to WZZIP -r *.TXT
0
Comment
Question by:orionpm
1 Comment
 
LVL 30

Accepted Solution

by:
SteveGTR earned 50 total points
ID: 16954316
You could do something like this.

@echo off

setlocal

set rootDir=%~1

if "%~1"=="" set rootDir=.

if not exist "%rootDir%" echo %~1 does not exist.&goto :EOF

pushd "%rootDir%"

for /r "%rootDir%" %%a in (*.*) do echo pkzip "%%a" "%%~na.zip"

popd

I've disabled the pkzip line by echo it out. I'm not even sure of the syntax. This should give you a good start. The batch file accepts a root directory to start in.

Good Luck,
Steve
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

16 Experts available now in Live!

Get 1:1 Help Now