Tanks, i´ll try it
In this forum i found another Tip, in creating a Blank ZIP file with "PK"
bytes and 17 bytes with CHR(0)
I´ll try to see
============================================
Set Ag=Wscript.Arguments
username = CreateObject("Wscript.Shell").Environment("Process")("username")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts =
fso.OpenTextFile(FilePath&"_forms\workforus\_uploads\"&"form_data.zip", 2,
vbtrue)
BlankZip = "PK" & Chr(5) & Chr(6)
For x = 0 to 17
BlankZip = BlankZip & Chr(0)
Next
ts.Write BlankZip
set objFolder = nothing
set objShell = nothing
Set fso = nothing
Set ts = nothing
Set objShell = CreateObject("Shell.Application")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set
DestFldr=objShell.NameSpace(FilePath&"_forms\workforus\_uploads\"&"form_data.zip")
Set SrcFldr=objShell.NameSpace(FilePath&"_forms\workforus\_csv")
DestFldr.CopyHere (FilePath&"_forms\workforus\_csv")
============================================
Post by LJBPost by FBHo can i create Zip Files via command-line?
Can be done via WMI?
I don´t wann use WinZIP COmmand Line Add-On, because it is not freeware
Can i use VBScript to do that? Other "Lnaguage" maybe?
Since Windows already knows how to deal with zip files to some extent you
might want to try the following. No external programs are needed. Believe it
or not the wscript.sleep at the end is important to make this work
correctly.
Const FOF_CREATEPROGRESSDLG = &H0&
Const MyZip = "C:\..\MyZipFile.zip"
Const File1 = "C:\..\File1.txt"
Const File2 = "C:\..\File2.txt"
Const MyDest = "C:\scratch"
'-------------- create empty zip file ---------
'Create the basis of a zip file.
CreateObject("Scripting.FileSystemObject") _
.CreateTextFile(MyZip, True) _
.Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar)
'-------------- zip ---------------------------
'get ready to add files to zip
With CreateObject("Shell.Application")
'add files
.NameSpace(MyZip).CopyHere File1, FOF_CREATEPROGRESSDLG
.NameSpace(MyZip).CopyHere File2
End With
wScript.Sleep 1000