WAS: Need some help...



Stephany,

I owe you a debt of gratitude. With your assistance, I was able to find a
way to do what I wanted to do, even though I don't consider myself a
developer by any mean's. I now have something I can take to work and use to
make things a bit easier on my techs. While I doubt that the coding is all
that elegant, here is the final sub that I was able to come up with that is
doing the job I need it to do. Again, thanks for all the assistance. Happy
Holidays.

Private Sub CompressFolder()

Dim strSourceDir As String = txtSelectDir.Text

Dim strTargetDir As String = txtWriteDir.Text

Dim _Folders As String() = Directory.GetDirectories(strSourceDir)

prbProgress.Minimum = 0

prbProgress.Maximum = CInt(_Folders.Length)

prbProgress.Step = 1

For Each _Folder As String In _Folders

Dim strFldr2Compress As String = Path.GetFileName(_Folder)

Dim strFinalFile As String = Path.ChangeExtension(Path.Combine(strTargetDir,
_

Path.GetFileName(strFldr2Compress)), "cab")

Dim i_Compress As CabLib.Compress = New CabLib.Compress()

i_Compress.CompressFolder(strTargetDir, strFinalFile, "", 0)

prbProgress.PerformStep()

lblProgress.Text = ("Compressing: " & strFinalFile)

Next

End Sub

"Stephany Young" <noone@localhost> wrote in message
news:e1ULsLRHHHA.2456@xxxxxxxxxxxxxxxxxxxxxxx
I can only suggest that you try it and see if it will work for you. If you
do then also test the extraction methods to ensure that you can actually
'restore' the data from the compressed file.


.



Relevant Pages

  • Re: Size On Disk
    ... Here is some code I wrote a while ago to count the files and folders in any selected drive or folder and report the number of files and folders found together with their total file size and their total size on disk. ... Private Declare Sub CopyMemory Lib "kernel32" _ ... ByVal sDir As String) As Long ... Dim s1 As String, sectorsPerCluster As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Can I do this?
    ... You can create folders and files in Excel. ... Dim iCol As Integer ... Dim myRootFolder As String ...
    (microsoft.public.excel.programming)
  • File Aging Program
    ... and count including all the folders inside of folder1. ... Sub DirSearch(ByVal sDir As String) ... Dim d As String ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Folders- First layer only
    ... > each media into a list/database which can then be searched. ... This'll grab a list of folders starting from the path you pass. ... Dim oColl As Collection ... Private Function GetList(StartPath As String) As Collection ...
    (microsoft.public.vb.general.discussion)
  • Re: Folders in a certain location
    ... i am wanting some code that will write all the folders in a certain ... Dim sFile As String ... Dim sArray() As String ...
    (microsoft.public.vb.general.discussion)