You mean just creating a normal .zip file right? Use the forum search, there's any number of ways to compress a file into a zip. There's the one I did, then another one using shell32.dll by Sweeve, then here's a thread with a whole bunch of links to zip projects... there's lots of resources available. If none of those fit, maybe better describe your particular needs?
You mean just creating a normal .zip file right? Use the forum search, there's any number of ways to compress a file into a zip. There's the one I did, then another one using shell32.dll by Sweeve, then here's a thread with a whole bunch of links to zip projects... there's lots of resources available. If none of those fit, maybe better describe your particular needs?
I want to compress a .bak file in the C: \ Program Files \ Pajoohesh \ Dana... folder and upload it to a site (since the file size is high)
(Sorry I do not know English well)
I'm an administrative officer. I want to write a letter that the back up of the circuit once a month is automatically sent to the administration (for the archive) since the volume of the backup should be first compressed. I did not work much Visual Basic just amateur
Hello dear friends. I'm a member of the Education Department. I worked as an amateur Visual Basic. One of the problems that we are involved with in our area of education is that student information systems are removed due to viruses or negligence in maintenance. How many times I thought I'd plan to download the latest student school system back up to a ftp, and we'll download and maintain it for archiving. . I went to some places, but the back up of the .bak extensions is too large, and it takes too much time to upload it to the low speed Internet of schools, and if we squeeze that file, it dramatically drops. I'd like to write from my professors a code that I can write to a text box like "C: \ Program Files \ Pajoohesh \ Dana \ Danabackup64309802-971011.bak" and press the same button as the compressed address, or to zip or rar so I can upload it. Thank you for helping me.
Last edited by Ourio93; Apr 16th, 2018 at 05:30 AM.
There are many ways to do this programmatically, and fafalone has given you some links, but if you have no experience in coding VB6, the best option is perhaps to just use a free zipper like 7-Zip. You can use a batch file to automate tasks in 7-zip (and other archivers).
The code works as is, when you click 'Create Zip File' it will create the zip file.
oleexp.tlb is a file; download oleexp442.zip from the thread here, open it, and extract oleexp.tlb to \Windows\SysWOW64. After that, in the VB IDE, go to Project->References, then click 'Browse...' and select it.
You passed a blank list; sFiles needs to contain the file(s) you want to zip. The contents of List1 need to be in sFiles, if you're going to do that manually instead of with the file picker:
Code:
Private Sub Command3_Click()
On Error Resume Next
If (Text1.Text = "") Or (List1.ListCount = 0) Then
Beep
Exit Sub
End If
Dim i As Long
ReDim sFiles(List1.ListCount - 1)
For i = 0 To List1.ListCount - 1
sFiles(i) = List1.List(i)
Next i
ZipFiles Text1.Text, sFiles
End Sub