Zip delete in subfolder

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts Page 1 of 1
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Zip delete in subfolder
AnoPem
Is it possible to delete all files from a folder that contains the same names as files in a zip file ?
https://t.me/pump_upp
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Re: Zip delete in subfolder
clanc789
If you list them you can delete them, if its for updating you can overwritecopy them?
Practice makes perfect!

VIP since: 6-10-2011
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: Zip delete in subfolder
AnoPem
clanc789 wrote:
If you list them you can delete them, if its for updating you can overwritecopy them?
ive been trying to use the unzip function from this http://www.codeproject.com/Tips/257193/ ... ws-Shell32 but whenever theres a files named the same in the directory it prompt me with do you want to overwrite, but i cannot find a way around it
https://t.me/pump_upp
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Re: Zip delete in subfolder
clanc789
Do you know what the file names are? Or are they different because you made an extraction program? If the file names are the same time after again: use my.computer.filesystem.deletefile to delete the requested files and then extract them.
Practice makes perfect!

VIP since: 6-10-2011
User avatar
noypikami
VIP - Donator
VIP - Donator
Posts: 151
Joined: Sat Dec 22, 2012 1:49 am

Re: Zip delete in subfolder
noypikami
i've modify some codes from your project taken from the link that you have provided in codeproject website,

its pretty working now... here's the link to the whole project, its been zip using the project zip itself.



hope this helps...!

http://www.mediafire.com/?1n2j3x1wsxjghp4


ON ZIP additional functions: it zip folders and create the same name of the folder as zip
in the current directory, you can zip the file again and create another
zip file with out deleting the first one in the same directory.

example: original folder name = new
first zip attempt ' name= new.zip
second zip attempt 'name = new2.zip
second zip attempt name = new3.zip and so on with in the same directory.

ON UNZIP additional functions: unzip file and place in the same directory without deleting
the original
zip file
on second attempt if unzip on the same directory it will ask you either to replace or to
create a new set of file.

ON THE OTHER HAND: IF YOU WANT TO delete the original directory, this you have to add
an additional modifications on the button UNZIP button like this
Code: Select all
imports system.io
Code: Select all
My.Computer.FileSystem.deletedirectory(thepathofzipfile) = true
or if you want to delete the files inside a certain directory, do like this
Code: Select all
Dim cc = "the directory of your file"
               Dim dirinfo As New System.IO.DirectoryInfo(cc)
               Dim files() As System.IO.FileInfo
               files = dirinfo.GetFiles("*", IO.SearchOption.AllDirectories)
                For Each file In files
                file.delete()
               next
=============================================================================
=============================================================================
5 posts Page 1 of 1
Return to “Coding Help & Support”