Pumaedition (22nd April 2008)
hi all, i really need a script or .bat file or something that can delete the contense of the Documents and settings folder (ie all the user profiles) on the clients machines . i would lik eto be able to do it from the server without having to go to each machines and manually select them and delete tham. if any clarification is needed let me know because i am not great at explaining my issues.
cheers
You can use delprof.exe from Microsoft to remove profiles, we have it configured via group policy to run at machine startup.
Just a batch file with delprof /Q /D:1 in it.
Hope that helps.
User Hive Cleanup service is the MS app you need.
http://www.microsoft.com/downloads/d...displaylang=en
cheers guys for the responses. Tango, that script did not work it entered delprof /Q /D:PC018
delprof /Q /D:PC019
but it didnt work, if this is wrong please correct me. oh and i need it to run without me having to confirm everything it is deleting
I use the script below, you can edit it to keep certain folders such as we have 'default user' administrator and all users' The chice is yours.
It has worked very well for us.
Function Main()
On Error Resume Next
Dim obtainfolder
Dim PathFolder
Dim strPath
Set fso = CreateObject("Scripting.FileSystemObject")
strPath = "C:\Documents and Settings\"
Set f = fso.GetFolder(strPath)
' Loop through all subfolders
For Each fldrItem in f.SubFolders
fldrName = fldrItem.name
If Right(strPath,1) <> "\" Then
PathFolder = strPath & "\" & fldrName
Else
PathFolder = strPath & fldrName
End If
Select Case fldrName
Case "Administrator":
Case "All Users":
Case "Default User":
Case Else:
set obtainfolder = fso.GetFolder(PathFolder)
obtainfolder.Delete true
End Select
Next
' Clean up objects
Set fso = Nothing
Set fc = Nothing
End Function
call Main()
Pumaedition (22nd April 2008)
Sorry, double post when our shi*e internet was playing up.
I use the script below, you can edit it to keep certain folders such as we have 'default user' administrator and all users' The chice is yours.
It has worked very well for us.
Function Main()
On Error Resume Next
Dim obtainfolder
Dim PathFolder
Dim strPath
Set fso = CreateObject("Scripting.FileSystemObject")
strPath = "C:\Documents and Settings\"
Set f = fso.GetFolder(strPath)
' Loop through all subfolders
For Each fldrItem in f.SubFolders
fldrName = fldrItem.name
If Right(strPath,1) <> "\" Then
PathFolder = strPath & "\" & fldrName
Else
PathFolder = strPath & fldrName
End If
Select Case fldrName
Case "Administrator":
Case "All Users":
Case "Default User":
Case Else:
set obtainfolder = fso.GetFolder(PathFolder)
obtainfolder.Delete true
End Select
Next
' Clean up objects
Set fso = Nothing
Set fc = Nothing
End Function
call Main()
Can a admin delete these multi posts for me please..............
Bloody LEA internet. :twisted:
Sorry , was typing that off the top of my head , just checked the batch file were have for machine start up and its :-
%windir%\delprof /q /i /d:0
Obviously we have delprof.exe copied to the windows dir on each PC.
We also run it manually on each PC when doing a general tidy up in case the PC hasnt been rebooted for a while. I work in a Uni so there can be perhaps 20 students logging on to a PC each day so they can build up over a few days if the PC hasnt been rebooted.
I have scripts to WOL all the PCs and then using psshutdown from Sysinternals pstools reboot them all , and I try to do this every so often early in the morning when nobody is logged on.
Does anyone factor in orphans i.e. D&S folders that aren't listed in the registry and in principle won't be touched by delprof?
[Don't ask me how that happens, but I've definitely seen them around]
If you take a look at this thread from before :
http://edugeek.net/index.php?name=Fo...iewtopic&t=405
There are currently 1 users browsing this thread. (0 members and 1 guests)