Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ZIP - create blank zip and copy file to

Status
Not open for further replies.

scottohum

IS-IT--Management
Jul 5, 2011
14
GB
i am trying to zip a file yousing the function shown at the end of this thread:

i have tried the first part to crate the blank zip but i get error on line5 char1 saying path not found.

Set Ag=Wscript.Arguments
username = CreateObject("Wscript.Shell")_
.Environment("Process")("username")
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso_OpenTextFile("c:\test1\"&UserName &" "&Date()&".zip", 8, 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


Can someone give me some help and indication as to why i am getting this error.

Many thanks

S
 
why i am getting this error
Because the Date() function returns illegal characters for a pathname ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top