Page 2 of 2 <12
Topic Options
#75421 - 2003-06-27 11:06 AM Re: Recursive Zip
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Someone slap me for suggesting WinRAR [Wink]

...or rather, the 32bit commandline version rar.exe included with WinRAR.

[ 27. June 2003, 11:11: Message edited by: masken ]
_________________________
The tart is out there

Top
#75422 - 2003-06-27 06:55 PM Re: Recursive Zip
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Or even NTBACKUP (comes free with Windows [Big Grin] ). You can even create your own backup jobs with KiXtart as the backup job files are plain-text files, than call NTBACKUP via command-line and there you go.
_________________________
There are two types of vessels, submarines and targets.

Top
#75423 - 2003-06-28 12:50 AM Re: Recursive Zip
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ntbackup is fantastic (use it currently for my most important data-backups) but it needs to access desktop...
and it's totally interrubtable by user currently logged on...
at least on NT [Wink]
_________________________
!

download KiXnet

Top
#75424 - 2003-06-28 04:15 AM Re: Recursive Zip
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Have you tried to run it via Task Scheduler under it's own account? Then the current user should not be able to see the GUI.
_________________________
There are two types of vessels, submarines and targets.

Top
#75425 - 2003-06-30 08:54 AM Re: Recursive Zip
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
NTBACKUP would not allow you to accomplish one of the requirements of creating a separate archive for each parent folder.
(well, one could I guess, but not very efficiently)

Calling Phoenix...!! What is your input to this? What is the reason and FULL requirements?

Plenty of knowledgeable people here willing to help you, but we need all the details.

[ 30. June 2003, 08:56: Message edited by: NTDOC ]

Top
#75426 - 2003-06-30 03:23 PM Re: Recursive Zip
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Yes, it can do that. Create a script that calls NTBACKUP multiple times, and each time one of the parent folder will get backed up. Just rewrite the NTBACKUP backup set file to point to each of the parent folder.
_________________________
There are two types of vessels, submarines and targets.

Top
#75427 - 2003-06-30 06:56 PM Re: Recursive Zip
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Yeah, that is why I said not very efficient though at least time wise.

Hopefully Phoenix will reply with his real requirements.

Top
#75428 - 2003-07-08 01:01 PM Re: Recursive Zip
Fernando Madruga Offline
Starting to like KiXtart

Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
Using 4NT and Info-ZIP:

for /a:D/H %f in ( * ) ( echo %f %+ zip -9 -r -! -D "%f.zip" "%f\*" )

This will create one zip file for each folder in the current one with the same name as the folder using max compression (-9), recursion (-r), NT file attributes (-!), and not storing the "folder" entries (-D).

I know this isn't Kix, but NTDOC and others will gladly "KiX" it... [Smile]

The advantage of this Zip is that it is free...
_________________________
Later,   [b]Mad[/b]ruga

Top
#75429 - 2003-07-08 01:10 PM Re: Recursive Zip
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh.
you need the udf:
MakeCab() - Create windows cabinet file package with specified files included

to use this.
code:
$full_paths_to_Files ="list of files which you generate"
$packagefile = "the_package-file's fullpath"

$returncode=makecab($packagefile,$full_paths_to_Files)
if @error or len($returncode)
"error occured:" $returncode+@error
else
"package created"
endif

_________________________
!

download KiXnet

Top
#75430 - 2004-04-22 12:15 AM Re: Recursive Zip
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Correct path to this UDF now that the board has been upgraded.

MakeCab() - Create windows cabinet file package with specified files included


Top
#171040 - 2006-12-05 07:21 AM Re: Recursive Zip [Re: NTDOC]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Quote:
Correct path to this UDF now that the board has been upgraded.

MakeCab() - Create windows cabinet file package with specified files included



And this upgrade didn't break it this time

.

Top
#171783 - 2006-12-20 11:14 AM Re: Recursive Zip [Re: NTDOC]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Also check the syntax. compare these two:
Code:
break on
;
$basedir="c:\cli\Clients"
$filename=dir("$basedir\*")
$archdir="c:\zip\"

WHILE ($filename <> "") AND (@error = 0)
IF ($filename <> ".") AND ($filename <> "..") AND (GetFileAttr($basedir+"\"+$filename) & 16)
GOSUB "create_zip"
ENDIF
$filename=dir()
LOOP
EXIT

:create_zip
$cmd=" wzzip -a -ex -rp "
$cmd=$cmd+' "$basedir\'+LTRIM(RTRIM($filename))+'.zip" "$basedir\'+LTRIM(RTRIM($filename))+'" '
SHELL '%comspec% /c $cmd '

Syntax-corrected:
Code:
break on
;
$basedir="c:\cli\Clients"
$filename=dir("$basedir\*")
$archdir="c:\zip\"

WHILE $filename <> "" AND @error = 0
IF $filename <> "." AND $filename <> ".." AND GetFileAttr($basedir+"\"+$filename) & 16
GOSUB "create_zip"
ENDIF
$filename=dir()
LOOP
EXIT

:create_zip
$cmd=" wzzip -a -ex -rp "
$cmd=$cmd+' "$basedir\'+LTRIM(RTRIM($filename))+'.zip" "$basedir\'+LTRIM(RTRIM($filename))+'" '
SHELL '%comspec% /c $cmd '



Sidenote: gosub and etc is.. dangerous. I started out with using that as well, but there's better options.


Edited by Björn (2006-12-20 11:15 AM)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#171798 - 2006-12-20 02:54 PM Re: Recursive Zip [Re: Björn]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
björn, you just removed the brackets?
as I can't find any real syntax difference...
_________________________
!

download KiXnet

Top
#171807 - 2006-12-20 03:39 PM Re: Recursive Zip [Re: Lonkero]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Aye, that I did. something tells me that that works as well. haven't seen it before tho.
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#171809 - 2006-12-20 03:44 PM Re: Recursive Zip [Re: Björn]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is lonkifying and then there is deMCAing. That is classic deMCAing.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#171903 - 2006-12-22 03:01 AM Re: Recursive Zip [Re: Les]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
http://home.comcast.net/~habullock/habobjects.htm

Just use one of the DIR functions to get an array of filenames. Then:
Code:
?
$Zip2 = $HABObject.Zip()

$files = "C:\Data\Scripts\PerlCtrl\objects\Zip.html",
         "C:\Data\Scripts\PerlCtrl\objects\HABobjects2.DLL",
         "C:\data\scripts\[censored].kix"

for each $file in $files
    $member = $Zip2.addFile( $file )
    if $Zip2.writeToFileNamed( "C:\Data\Scripts\PerlCtrl\objects\Test.zip" ) = 0
       ? "Added: " + $file
    endif
next
 
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#171904 - 2006-12-22 03:31 AM Re: Recursive Zip [Re: Howard Bullock]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
What nasty stuff you writing that the board censors it Howard?


"C:\data\scripts\[censored].kix" ?

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.074 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org