kixnewbie
|
(Fresh Scripter)
|
2004-04-21 03:19 PM
|
|
|
|
|
$Date only 8 chr?
|
|
Okay my problem is that only creats a 2004_04_.zip and on the logfile the script writes 2004_04_21.zip I don't know why.
Code:
$apath = "C:\KiX\Archiv" ;Pfad zum Archiv-Folder $opath = "C:\KiX\Out" ;Pfad zum Out-Folder $logfile = "C:\KiX\log.txt" ;logfile $Date = join(split("@DATE",'/'),'_')
Shell '%ComSpec% /c C:\KiX\pkzip -a C:\KiX\Archiv\$Date.zip $apath\*.*' Shell '%ComSpec% /c echo @TIME - @DATE - Backup Datei wurde erstellt ($Date.zip) >> "$logfile"'
|
|
Re: $Date only 8 chr?
|
|
Easy one this.
Your version of PKZIP only supports DOS 8.3 filenames.
Upgrade to a newer version that supports long filenames.
|
kixnewbie
|
(Fresh Scripter)
|
2004-04-21 04:00 PM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
I think I have the newest. I don't want to install something so i googled and only found v1.1 & v2.06.. where can i get the newest one?
I only need the pkzip.exe :>
|
Chris S.
|
(MM club member)
|
2004-04-21 04:24 PM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
If you want to just get the short name of the file you can use fnGetFileProp()
Code:
fnGetFileProp($sFile,ShortPath)
|
|
Re: $Date only 8 chr?
|
|
Quote:
If you want to just get the short name of the file you can use fnGetFileProp()
Code:
fnGetFileProp($sFile,ShortPath)
Not quite it - he wants to create a 10 character zipped file, but pkzip is truncating it to 8.3
|
Kdyer
|
(KiX Supporter)
|
2004-04-21 07:07 PM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
Do you have WinZIP? There is also a Command-line version of it as well.
Kent
|
kixnewbie
|
(Fresh Scripter)
|
2004-04-22 08:54 AM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
No I haven't. But i won't install a software.. it should be only a *.exe. So pkzip.exe is the best I think, but where I can get the newst version?
|
Kdyer
|
(KiX Supporter)
|
2004-04-22 02:14 PM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
Have you tried http://www.pkware.com ?
Kent
|
kixnewbie
|
(Fresh Scripter)
|
2004-04-22 02:18 PM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
Yes. I do niw filenames like: 20040403.. so problem resolved.
|
Lonkero
|
(KiX Master Guru)
|
2004-04-26 12:03 AM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
solved? nah. worked out? yes...
why you want it to be zip? isn't cab-suitable? just asking as kixtart can create cab-packages... there is some OS limit though, which I can remember now...
|
NTDOC
|
(KiX Master)
|
2004-04-26 12:39 AM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
Here are a couple of similar posts on the subject of using WinZip, or as Lokero suggests mabye doing it with CAB files.
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=117197 http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=75192
|
ShaneEP
|
(MM club member)
|
2004-04-26 03:19 AM
|
|
|
|
|
Re: $Date only 8 chr?
|
|
here is another zip example...
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=115967
|
|
Re: $Date only 8 chr?
|
|
You could also:
Code:
$HABObject = createobject("HBullock.AdminObjects")
if vartypename($HABObject1) <> "Object"
? "@serror"
endif
$Zip1 = $HABObject.Zip("C:\Data\Download\BBchecker.zip")
$num = $Zip1.numberOfMembers
? @serror
? "Num of files in archive: " + $num
?
; Output list of files in the archive
; Note the use of the "List" method to make the array. This is case sensitive.
$files = $Zip1.List.memberNames
$x=1
for each $member in $files
? "" + $x + ": " + $member
$x = $x + 1
next
; Get a file from the archive as an object
?
$file = "view.kix"
$member = $Zip1.memberNamed( $file )
? "compressionMethod = " + $member.compressionMethod
? "lastModFileDateTime = " + $member.lastModFileDateTime
? "crc32string = " + $member.crc32String
? "uncompressedSize = " + $member.uncompressedSize
? "compressedSize = " + $member.compressedSize
; Extract file to a specified location.
?
$rc = $member.extractToFileNamed( "C:\Data\Scripts\PerlCtrl\objects\" + $file )
if $rc = 0
? "Extraction was successful"
else
? "Extraction Failed: $rc @serror"
endif
?
$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
|