Page 1 of 1 1
Topic Options
#118399 - 2004-04-21 03:19 PM $Date only 8 chr?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
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"'


Top
#118400 - 2004-04-21 03:28 PM Re: $Date only 8 chr?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Easy one this.

Your version of PKZIP only supports DOS 8.3 filenames.

Upgrade to a newer version that supports long filenames.

Top
#118401 - 2004-04-21 04:00 PM Re: $Date only 8 chr?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
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 :>


Edited by kixnewbie (2004-04-21 04:07 PM)

Top
#118402 - 2004-04-21 04:24 PM Re: $Date only 8 chr?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
If you want to just get the short name of the file you can use fnGetFileProp()

Code:

fnGetFileProp($sFile,ShortPath)


Top
#118403 - 2004-04-21 05:35 PM Re: $Date only 8 chr?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
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

Top
#118404 - 2004-04-21 07:07 PM Re: $Date only 8 chr?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Do you have WinZIP? There is also a Command-line version of it as well.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#118405 - 2004-04-22 08:54 AM Re: $Date only 8 chr?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
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?
Top
#118406 - 2004-04-22 02:14 PM Re: $Date only 8 chr?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Have you tried http://www.pkware.com ?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#118407 - 2004-04-22 02:18 PM Re: $Date only 8 chr?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Yes. I do niw filenames like: 20040403.. so problem resolved.
Top
#118408 - 2004-04-26 12:03 AM Re: $Date only 8 chr?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
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...
_________________________
!

download KiXnet

Top
#118409 - 2004-04-26 12:39 AM Re: $Date only 8 chr?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11567
Loc: CA
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

Top
#118410 - 2004-04-26 03:19 AM Re: $Date only 8 chr?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2080
Loc: Tulsa, OK
here is another zip example...

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=115967

Top
#118411 - 2004-04-26 05:27 AM Re: $Date only 8 chr?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
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

_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 191 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.035 seconds in which 0.011 seconds were spent on a total of 12 queries. Zlib compression enabled.

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