Solved

WZZIP from command line question

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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