Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extract File_id.diz & Save As Same Name As Zip File

5 views
Skip to first unread message

FileGod

unread,
Feb 10, 2008, 3:54:02 AM2/10/08
to
I wrote program some time back that zips a File_id.diz save as the same name
as the zip file so I decided to write a bacth file that does the opposite &
grabs the File_id.diz from zip files & save them as the same name as the zip
files but with the extention .diz since there have been a lot of files I
downloaded more than once, these are automating batch files so do not type in
a file name when running these batch files...

GrabDiz.bat, this runs the batch files...
Call GetDiz.bat
Rename-Diz.bat

--------------------------------------------------------------------------------------------
GetDiz.bat, the gets the File_id.diz & save it as the same name as the zip
files but the diz will have the extention .zip.diz & this is the main bact
file that does the main work...
if not (%1) == () goto GetDiz
for %%a in (*.zip) do call GetDiz %%a
goto end
:GetDiz
set Diz=%1
pkunzip -e %1 File_id.diz
ren File_id.diz %Diz%.diz
ren *.zip.diz *.diz
:end

--------------------------------------------------------------------------------------------
Rename-Diz.bat, this batch file moves the diz file to a temporary directory to
change the file extention from .zip.diz to .diz & moves the diz files back to
the original directory...
md Diz's
move *.zip.diz Diz's
cd Diz's
ren *.zip.diz *.
ren *.zip *.diz
move *.diz ..
cd..
rd Diz's

--------------------------------------------------------------------------------------------
ZipFix.bat, Oh, here is a old batch file we made in BatPower a long time ago
that does runs PKZIPFIX automatically...
if not (%1) == () goto pkzipfix
for %%a in (*.zip) do call pkzipfix %%a
goto end
:pkzipfix
pkzipfix %1
del %1
ren pkfixed.zip %1
:end

--------------------------------------------------------------------------------------------
My program that does diz the files does not work with Windows XP so I am
thinking of just writing a batch file that will diz the files, even my CD
catalog program does not work with XP so I will have to write something to
replace it unless I slap a virtual machine on the system & run 98 just to run
my DOS programs, I even had a Tic Tac Toe batch file game that ran on DOS 6.22
but it would not run on 95 or 98.
I hope this helps folks out...
http://www.filegod.netfirms.com

Richard Bonner

unread,
Feb 10, 2008, 9:46:41 AM2/10/08
to
FileGod (som...@some.com) wrote:
> I wrote program some time back that zips a File_id.diz save as the same name
> as the zip file so I decided to write a bacth file that does the opposite &
> grabs the File_id.diz from zip files & save them as the same name as the zip
> files but with the extention .diz since there have been a lot of files I
> downloaded more than once, these are automating batch files so do not type in
> a file name when running these batch files...
(Snip)

*** I may be misunderstanding what you are doing, but can one not just:

PKZIP File_id.ZIP File_id.diz


If you want to delete the .diz file at the same time:

PKZIP -m File_id.ZIP File_id.diz


To restore:

PKUNZIP File_id.ZIP
DEL File_id.ZIP

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

Todd Vargo

unread,
Feb 10, 2008, 10:47:34 AM2/10/08
to
FileGod wrote:
> I wrote program some time back that zips a File_id.diz save as the same
name
> as the zip file so I decided to write a bacth file that does the opposite
&
> grabs the File_id.diz from zip files & save them as the same name as the
zip
> files but with the extention .diz since there have been a lot of files I
> downloaded more than once, these are automating batch files so do not type
in
> a file name when running these batch files...
>
> GrabDiz.bat, this runs the batch files...
> Call GetDiz.bat
> Rename-Diz.bat
>
> --------------------------------------------------------------------------
------------------
...
> --------------------------------------------------------------------------

------------------
> My program that does diz the files does not work with Windows XP so I am
> thinking of just writing a batch file that will diz the files, even my CD
> catalog program does not work with XP so I will have to write something to
> replace it unless I slap a virtual machine on the system & run 98 just to
run
> my DOS programs, I even had a Tic Tac Toe batch file game that ran on DOS
6.22
> but it would not run on 95 or 98.
> I hope this helps folks out...
> http://www.filegod.netfirms.com

As a FileGod, you should have no problem handling files on XP.

Cleaning up your website, both visually and grammatically, might make it
more appealing to your readers. That is just my opinion. HTH

--
Todd Vargo
(Post questions to group only.)

Todd Vargo

unread,
Feb 10, 2008, 11:11:20 AM2/10/08
to
Richard Bonner wrote:
> FileGod wrote:
...
> > I decided to write a bacth file that...

> > grabs the File_id.diz from zip files & save them as the same name as the
zip
> > files but with the extention .diz since there have been a lot of files I
> > downloaded more than once, these are automating batch files so do not
type in
> > a file name when running these batch files...
> (Snip)
>
> *** I may be misunderstanding what you are doing, but can one not just:

I distilled FileGod's text to hopefully help with your confusion.

File_id.diz represents a non-static name nor the same basename as the zip,
hence, his code is intended to extract *.diz from the zip and rename it to
the basename of the zip.

FWIW, I don't find it of particular interest to me.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

Todd Vargo

unread,
Feb 10, 2008, 12:01:23 PM2/10/08
to
Todd Vargo wrote:
> Richard Bonner wrote:
> > FileGod wrote:
> ...
> > > I decided to write a bacth file that...
> > > grabs the File_id.diz from zip files & save them as the same name as
the
> zip
> > > files but with the extention .diz since there have been a lot of files
I
> > > downloaded more than once, these are automating batch files so do not
> type in
> > > a file name when running these batch files...
> > (Snip)
> >
> > *** I may be misunderstanding what you are doing, but can one not
just:
>
> I distilled FileGod's text to hopefully help with your confusion.
>
> File_id.diz represents a non-static name nor the same basename as the zip,
> hence, his code is intended to extract *.diz from the zip and rename it to
> the basename of the zip.

Correction: File_id.diz is a static name.

> FWIW, I don't find it of particular interest to me.

BTW, the following single batch performs what FileGod used 2 batch files to
accomplish and without need to clean up the double .zip.diz extensions.

Note, like FileGod's code, this batch only operates on 8.3 filenames as I
don't find the batch of particular use to bother including LFN with spaces
support.

@echo off
if not (%1)==() goto GetDiz
if exist File_id.diz del File_id.diz
md Diz's
for %%a in (*.zip) do call %0 %%a
rd Diz's
set basename=
goto end
:GetDiz
cd Diz's
echo.>%1
ren %1 *.
for %%? in (*.*) do set basename=%%?
del %basename%
cd..
pkunzip -e %1 File_id.diz
ren File_id.diz %basename%.diz
:end

FileGod

unread,
Feb 10, 2008, 1:22:33 PM2/10/08
to
It can be handy if you want to save the diz files & zip them & slap them on
your web site but it is also a example for creating other batch files, I know
many zip files do not have unique name but I do like to have the diz files,
this could be changed to create a file list generator batch file...

FileGod

unread,
Feb 10, 2008, 1:24:57 PM2/10/08
to
Ah, nice look mod, I will have to check it out!

FileGod

unread,
Feb 10, 2008, 1:32:15 PM2/10/08
to
Yeah, that works nice, I thought it could be done with just one batch file,
thanks Todd!

Esra Sdrawkcab

unread,
Feb 10, 2008, 1:30:57 PM2/10/08
to

Interesting yrmp folder name there!

Richard Bonner

unread,
Feb 11, 2008, 7:15:35 AM2/11/08
to
Todd Vargo (tlv...@sbcglobal.netz) wrote:
> FileGod wrote:
> > http://www.filegod.netfirms.com

> Cleaning up your website, both visually and grammatically, might make it
> more appealing to your readers. That is just my opinion. HTH
> --
> Todd Vargo

*** He does seem to have a problem with apostrophes and commas.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

Richard Bonner

unread,
Feb 11, 2008, 7:23:25 AM2/11/08
to
Todd Vargo (tlv...@sbcglobal.netz) wrote:

> Richard Bonner wrote:
> > FileGod wrote:
> ...
> > > I decided to write a bacth file that...
> > > grabs the File_id.diz from zip files & save them as the same name as the
> > > > zip files but with the extention .diz since there have been a lot
> > > of files I downloaded more than once, these are automating batch
> > > files so do not type in a file name when running these batch files...
> > (Snip)
> >

> > *** I may be misunderstanding what you are doing...

> I distilled FileGod's text to hopefully help with your confusion.

*** Thanks, I appreciate that.

> File_id.diz represents a non-static name nor the same basename as the zip,
> hence, his code is intended to extract *.diz from the zip and rename it to
> the basename of the zip.

*** Ahh. Ok, in that case, I'd use 4DOS'S "FOR"command or XSET to
separate the filename from its extension and place it into a variable.
Then:

PKZIP %FILENAME%.ZIP %FILENAME%.DIZ


> FWIW, I don't find it of particular interest to me.
> --
> Todd Vargo

*** It is to me because I often need the filename without an extension
to have batch files do the type of file manipulations I typically require.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

Todd Vargo

unread,
Feb 11, 2008, 5:01:46 PM2/11/08
to
Richard Bonner wrote:

> Todd Vargo wrote:
> > FileGod wrote:
> > > http://www.filegod.netfirms.com
>
> > Cleaning up your website, both visually and grammatically, might make it
> > more appealing to your readers. That is just my opinion. HTH
>
> *** He does seem to have a problem with apostrophes and commas.

That is not what I had in mind at all. But IMO, posting specific nit-picks
in a newsgroup is inappropriate, therefore, I will refrain from further
comment.

--
Todd Vargo

0 new messages