Solved

WZZIP from command line question

Posted on 2006-06-21
1
411 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
[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
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

695 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