Results 1 to 14 of 14

Thread: zip one file in drive c: or d:

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Question zip one file in drive c: or d:

    Hello friends . I want to write a program to compress a file into drive c. please guide me

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,625

    Re: zip one file in drive c: or d:

    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?

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    Quote Originally Posted by fafalone View Post
    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)

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,854

    Re: zip one file in drive c: or d:

    Then first try the 3 sample projects fafalone pointed out to you.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    thank
    Attached Images Attached Images  
    Last edited by Ourio93; Apr 16th, 2018 at 05:01 AM.

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    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

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    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.

  8. #8
    Addicted Member jj2007's Avatar
    Join Date
    Dec 2015
    Posts
    205

    Re: zip one file in drive c: or d:

    Hi Ourio,

    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).

  9. #9
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,625

    Re: zip one file in drive c: or d:

    Ourio93, the error in post #5 is because your project needs to reference oleexp.tlb.

  10. #10

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    Please complete this source code. Thankful

    Name:  2.jpg
Views: 209
Size:  57.9 KB

    StgZip_Rev2

  11. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,625

    Re: zip one file in drive c: or d:

    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.

  12. #12

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    error : windows cannot create the compressed ....

    Name:  3.jpg
Views: 150
Size:  40.6 KB

  13. #13
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,625

    Re: zip one file in drive c: or d:

    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

  14. #14

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    13

    Re: zip one file in drive c: or d:

    thank you so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width