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.
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
Is it possible to delete all files from a folder that contains the same names as files in a zip file ?
If you list them you can delete them, if its for updating you can overwritecopy them?
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
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
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
VIP since: 6-10-2011
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
=============================================================================
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
or if you want to delete the files inside a certain directory, do like thisMy.Computer.FileSystem.deletedirectory(thepathofzipfile) = true
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
Copyright Information
Copyright © Codenstuff.com 2020 - 2023