Deleting files with selected dialogs

M

mmalinsky

I use

My.Computer.FileSystem.DeleteDirectory(target,
FileIO.UIOption.OnlyErrorDialogs, _
FileIO.RecycleOption.DeletePermanently,
FileIO.UICancelOption.DoNothing)

My.Computer.FileSystem to delete a folder, subfolders and files.
During this process, the standard Windows pop-up asking for
confirmation to delete files appears. While I do not want this pop-up,
I do want the Windows progress bar showing the status of the deletion
process. I have the options:

FileIO.UIOption.AllDialogs
FileIO.UIOption.OnlyErrorDialogs

AllDialogs does what I explained above while OnlyErrorDialogs fails to
show the progress bar.

Can anyone direct me to a solution?

Thanks,
Mike.
 
C

Chris Dunaway

I use

My.Computer.FileSystem.DeleteDirectory(target,
FileIO.UIOption.OnlyErrorDialogs, _
FileIO.RecycleOption.DeletePermanently,
FileIO.UICancelOption.DoNothing)

My.Computer.FileSystem to delete a folder, subfolders and files.
During this process, the standard Windows pop-up asking for
confirmation to delete files appears. While I do not want this pop-up,
I do want the Windows progress bar showing the status of the deletion
process. I have the options:

FileIO.UIOption.AllDialogs
FileIO.UIOption.OnlyErrorDialogs

AllDialogs does what I explained above while OnlyErrorDialogs fails to
show the progress bar.

Can anyone direct me to a solution?

System.IO.Directory.Delete(path, true)

Specify true for the second argument to delete all files and folders.
The deleted items will not go into the Recycle Bin.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top