Delete Prefetch Folder Contents

Dark Dominion
02-11-2007, 07:29 AM
I want to be able to delete the windows prefetch folder. However i don't know what's the right word to use so that the system finds automatically the right folder since not everybody installs windows on drive C:. i think it's %systemroot% but i'm getting an error. So please, enlighten me. Here's my code.

Dim file As String
For Each file In System.IO.Directory.GetFiles("%systemroot%\prefetch")
System.IO.File.Delete(file)
Next file

wayneph
02-11-2007, 03:58 PM
take a look at System.Environment.GetFolderPath() (http://msdn2.microsoft.com/en-gb/library/system.environment.getfolderpath(VS.71).aspx)

Mastertech
02-22-2007, 06:41 PM
Cleaning the prefetch folder is a Myth and will reduce performance. Why would you want to do this?

http://mywebpages.comcast.net/SupportCD/XPMyths.html

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum