Windows 2000 Local Profiles

H

harrm

I have used the following script on a mixture of XP and Windows 2000
machines.
On XP it has worked fine and all is ok however, on the Windows 2000
machines I am having real problems. When users are logging onto a
windows 2000 machine, it cannot find the users profile
(obviously as it has been deleted by the script) but it is not
rebuilding the users profile from default user, this is also the case
with the Admin user. Has anyone any suggestions how I can get round
this.

SCRIPT

Dim fso, f, f1, fc, s, folderspec, DeleteIt, strName


'If your Documents and Settings folder is not on C:, or isn't
'called Documents and Settings, change the folderspec variable
'to the correct location.
folderspec = "c:\Documents and Settings"


Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.GetFolder(folderspec)
Set fc = f1.SubFolders


For Each f1 in fc
CheckNames(f1.name)
Next


Set fso = Nothing


Sub CheckNames(strName)


'Check to see if the folder name matches one you want to keep
'if so, then exit this subroutine


'Add more lines to exclude specific user folders from being
'deleted automatically. Delete lines to have those folders
'deleted anyway.


If strName = "Default User" Then Exit Sub
If strName = "NetworkService" Then Exit Sub
If strName = "LocalService" Then Exit Sub
If strName = "All Users" Then Exit Sub
If strName = "Administrator" Then Exit Sub


'Since the folder name didn't match any of the ones above
'we delete it
On Error Resume Next
fso.DeleteFolder(folderspec & "\" & f1.name), True




End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top