B
Brian Cahill
Hi,
I am attempting to delete Profile folders from C:\Documents and
Settings\. I am receiving a Permission denied error when using the
Directory.Delete method. Here is my code. Is there any way around
this? I am a Local Administrator on the PC where I am running the
application. I have tried rebooting and I am not logged in as the user
I am trying to delete. The folder is not empty and contained both
hidden files and folders as well as read only folders. As part of my
troubleshooting, I disabled Read only and (unhided???) all the folders.
Thanks
Imports System
Imports System.IO
Public Class Test
Public Shared Sub Main()
' Specify the directories you want to manipulate.
Dim path As String = "c:\Documents and Settings\ctx1"
Try
'This operation will not be allowed because there are
subdirectories.
Directory.Delete(path, True)
Catch e As Exception
MsgBox(e.Message.ToString)
End Try
End Sub
End Class
I am attempting to delete Profile folders from C:\Documents and
Settings\. I am receiving a Permission denied error when using the
Directory.Delete method. Here is my code. Is there any way around
this? I am a Local Administrator on the PC where I am running the
application. I have tried rebooting and I am not logged in as the user
I am trying to delete. The folder is not empty and contained both
hidden files and folders as well as read only folders. As part of my
troubleshooting, I disabled Read only and (unhided???) all the folders.
Thanks
Imports System
Imports System.IO
Public Class Test
Public Shared Sub Main()
' Specify the directories you want to manipulate.
Dim path As String = "c:\Documents and Settings\ctx1"
Try
'This operation will not be allowed because there are
subdirectories.
Directory.Delete(path, True)
Catch e As Exception
MsgBox(e.Message.ToString)
End Try
End Sub
End Class