Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 26th, 2008, 02:40 PM
Registered User
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default emptying contents of temp folder using vb

Hi, I am new to VB ,but have been learning for a few months now and trying to write my own little disk cleanup utility (for a client)

I have got most of the app done but having the following issues which I hope someone would be kind enough to assist with:-

1) Can clean out windows/temp folder okay, but when it finds a file locked by a process it crashes - I have found out how to use error handlers etc to control the error but how can I unlock(?) the files in use before I try to delete them

2) How can I clear cookes, history, temp internet files etc from within vb? i have looked at my.computer.filesystem.specialdirectories.temp and also environment.specialfolders but cannot get it to work

Thanks for reading and in advance for any replies
Old June 27th, 2008, 10:38 AM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

To start with, use:
        ' Try the deletion here
    Catch ex As Exception
        ' Handle the error here.  Having entered the catch
        ' might be enough for you;  that will prevent your 
        ' app from crashing, anyway.
    End Try

Similar Threads
Thread Thread Starter Forum Replies Last Post
Emptying cells Europom Excel VBA 1 October 6th, 2008 09:28 AM
Folder Contents DataSource amzar ASP.NET 1.x and 2.0 Application Design 0 September 28th, 2007 06:06 AM
How to disable saving file in TEMP Folder sandeep.kharat ASP.NET 2.0 Basics 0 April 27th, 2006 12:43 AM
how to print the contents of datagrid using vb.net kumarkaushal VB.NET 2002/2003 Basics 1 March 21st, 2005 01:15 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.