473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Unable to delete Temporary Internet File folder

Alright, here it is I am trying to write a win32 app in VB 2005 to clean up user's profiles. everything works correctly except for the Delete("directory", True) statement. I get a System.IO.DirectoryNotFoundException: Could not find a part of the path. Then it gives me a random file name from the UserProfile\Local Settings\Temporary Internet Files\Content.IE5\SomeRandomFolder. This is absolutley driving me nuts. So I am gonn give you a basic Pseudo outline, just let me know if you need to see actual code.

Pseudo
1.) User provide the administrator's password, and then the administrator is authenticated against the Active Directory using the provided password.

2.) If authentication is successful another text field is provided to enter the name of the profile to clean i.e. jsmith then after a name is entered a list of computers on the domain is populated.

3.)The user selects multiple PCs from the list and the program runs through each one of the computers in the list and does the following:

a.) pings the computer to see if it is powered on or available if it is the loop is continued, if not the loop restarts with the next PC in the list.

b.) The next step checks the given computer i.e. \\computer name\c$\Documents and Settings\ for that particular user's profile folder.

c.) If the profile is found the code loops through each file in the directory and sets the attributes to vbNormal.

d.) The code then loops through each directory (and sub directory) found in the folder and sets the directories and sub directories attributes to vbNormal.

e.) After the attributes are set the directory is deleted (or at least the program attempts to delete the directory) using Directory.Delete("directory to delete", true) statement.

And that is where I run into trouble, the exception gets caught and throws it out to a dialog box and the program stops. When i go back and check the directory that is supposed to be deleted everything is deleted except for of course the user directory itself and the \Local Settings\Temporary Internet Files\Content.IE5 folder and files within those folders. I have tried everything that I can think of, I am logged in as a network administrator on my machine, I have logged onto my machine using the administrator account and run this program and it still does not work. I can delete the files manually through the file explorer and I have checked the permissions on the folders and files and the attributes all are set as they should be (the files or folders are not marked as read only as they were before i started the program so the set attributes is working the way it should, or at least it appears to be working the way it should). I can't think of anything else, so any help would be appreciated and please keep in mind that the last time I messed with Basic there was nothing Visual about it so talk to me as though I'm attending a 101 class.




Thanks in advance,

James T
Heartland, USA
Feb 12 '08 #1
0 2918

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: David N | last post by:
I got a solution that contains about 30 projects, three of which cannot be open. When I open the project, I always receive the error message "Unable to get the project file from the Web Server" ...
3
by: Jim | last post by:
Is it possible to read the Temporary Internet Files folder using C#? I'm messing with FileIO (newbie here) and everything seems to work fine until I try to read the list of files in this Temporary...
3
by: Rajiv Das | last post by:
VS 2003, XP SP2 ------------------------------------------------------------ DirectoryInfo temporary = new DirectoryInfo( Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));...
2
by: TM | last post by:
When I run an ASP.Net application I am getting the following error: "Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged."...
0
by: Marc Speed | last post by:
I have a windows server 2003 machine that cannot run any aspx pages. The pages are created on my XP machine and run fine on two other servers but this server keeps giving me the following error: ...
2
by: yxq | last post by:
Hi, I want to delete the files in "Temporary internet cache" and "History" folder, is it ok to use "File.delete"? What are the true path of "Temporary internet cache" and "History" folder? ...
1
by: Manish | last post by:
Hi all, Can any one plz suggest me how i can delete my temporary internet files within my Asp.net page. I am using C# as the code behind lang. Indeed, i have flash inserted on my .net page,...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
5
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.