nobody,
I am not sure how you do it on those clients, but you can always try to do
it with the diagonsic process
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fSystemDiagnosticsProcessClassTopic.asp
I hope this helps,
Cor
>I am writing this app in .net 2003 since all machines don't have 2.0
> framework. I am trying to delete old profiles, but I am getting access
[quoted text clipped - 16 lines]
> them deleted, and don't want to have to shell out to a third party app.
> Thanks for any help
nospam@meatonconsulting.com - 03 Nov 2006 16:03 GMT
Cor,
Thanks for the reply. I ended up writing a service, starting as Local
System since that always has full rights to the file system. I then
dropped down to Kernel32:
Private Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileA"
(ByVal lpFileName As String) As Long
Private Sub DeleteProfileFolder(ByVal UserHomeDir As String)
Try
Dim Folder As String
Dim File As String
For Each Folder In Directory.GetDirectories(UserHomeDir)
For Each File In Directory.GetFiles(Folder)
DeleteFile(File)
Next
DeleteProfileFolder(Folder)
Next
Catch Ex As Exception
WriteLog(Ex.ToString, 2)
End Try
End Sub
Unfortunately I had to use FSO.DeleteFolder to delete the main
directory since it has the force option, but all is working well now.
Hopefulle this can help out someone in the future.