# Visual Basic > Visual Basic 6 and Earlier >  compactar diretorio com progressbar

## gfranguelli

Prezados colegas:

Estou em busca de um código em vb6 para compactar um diretorio e se possível utilizando controle .ocx para rar ou zip para não ter a necessidade de referenciar o caminho da instalação do winrar ou winzip e se possível com uma progressbar para o andamento da cópia/compactação.

No formulário conter:

Text1 para caminho do diretorio;
Text2 para nome do arquivo a ser compactado;
Text3 destino do arquivo compactado;
Progressbar para andamento do progresso;
Botão para executar ação;

Agradeço desde já a atenção de todos. Muito obrigado

----------


## Peter Swinkels

@gfranguelli:

Welcome to the forum! Try https://www.example-code.com/vb6/zip.asp. And please try to write your posts in english. Okay? I used Google Translate to read your message. Perhaps it will produce acceptable results for posting in english.

----------


## Episcopal

> And please try to write your posts in english. Okay?


I found it strange, because what gfranguelli wrote, I understood perfectly because it was in Portuguese ... but what you wrote I didn't understand because I need to use google translator too .... then I woke up and saw that my page needed to be translated.

And speaking of google translations, these days I opened a post and there were 3 lines written in English, when I activated the translation plugin, google translator omitted the third line in the translation ... I had to select the text and use another translator to find out what was written ..... strange that.

----------


## Eduardo-

> Try https://www.example-code.com/vb6/zip.asp.


Are you aware that this is a paid component?

----------


## Peter Swinkels

@Eduardo: no I wasn't aware of that. Sorry.

Try: https://www.vbforums.com/showthread....-file-from-vb6

----------


## SamOscarBrown

OP---not sure if you are following all that above or not...but, I took the liberty to take one of the examples from this link (was one from above, eventually, I think)  and adopt one of dilettante's suggestions and make it more plainly for YOUR use (at least what I think you are looking for).  It uses a progressbar, and allows you to select a directory to archive as well as a directory to save the archived zip file it creates.  It is NOT my work, just some simple mods to help you.

You will have to download zlibWapi.dll (available at https://www.dlldownloader.com/zlibwapi-dll/).  Simply copy it into my attached program's directory...no registration required.

Good luck

----------


## gfranguelli

Dear colleagues, thank you very much for your attention here.

Unfortunately I am not able to make the progressbar follow the process of evolution of the compression of the files that are in the directory.

I have a file that its code in turn is relatively simple but I am not able to edit it for correct operation.

Could be putting the code here to analyze and someone fix it?

Thank you very much once again everyone.

----------


## SamOscarBrown

Sure...let's see the code.

----------


## gfranguelli

> Sure...let's see the code.


Dear Sam, thank you very much for taking the time to answer my topic and I'm sorry for not getting back to you sooner, life's setbacks.

See if you can fix the code below, because the progress bar doesn't follow the progress of the compression, a relatively small directory takes a long time, the friend who reports the message comments that he should modify "objDOS_ReceiveOutputs", I don't know how to do that!

error code link:
https://www.vbforums.com/showthread....th-progressbar


I'll take the opportunity and send you another link below a source code in Delphi that appears to be working, is it possible to convert this code to VB6?

https://forum.scriptbrasil.com.br/to...ando-com-zlib/

Thank you very much for your attention once again, and a happy 2023 that begins.

----------


## SamOscarBrown

Please post YOUR CODE for your progress bar.

----------


## gfranguelli

Dear Sam!

Attached are the files to be downloaded. 
There is a grades_help.txt file for some notes.

Thank you so much again.

----------

