locked
Delprof.exe deleting profile save some RRS feed

  • Question

  • hi i us delprof.exe bat to take profile off of a computer xp i want to save so user and not have to put them in every time how can i save the users and remove the rest we have set profiles like

    studenths

    teacherhs

    administrator

    i want to save all the profile above  but want to get rid of the 300 more off the computer

    Wednesday, October 23, 2013 5:44 PM

Answers

  • ... i want to save all the profile above  but want to get rid of the 300 more off the computer ...

    Hi,

        

    You can make use of the command Cacls to aid you.

        

    Here is an example, if you are running the batch file manually using your own account:

              Cacls "C:\Documents and Settings\studenths" /e /d <domain\account>

              <Add the cacls command (with /e /d switch) for all other profiles that you wish to save>

              "C:\Program Files\Windows Resource Kits\Tools\delprof.exe" /q /d:<days>

              Cacls "C:\Documents and Settings\studenths" /e /r <domain\account>

              <Add the cacls command (with /e /r switch) for all other profiles that you have added above>

       

    The /e switch edits the DACL instead of replacing it. 

    The /d switch will deny access for the specified user.

    The /r switch will revoke the access rights for the specified user.

        

    You may refer to this article, Cacls, for further information.

        

    Hope that helps.

        

    Cheers,


    Tas Chew

    Thursday, October 24, 2013 5:02 AM

All replies

  • ... i want to save all the profile above  but want to get rid of the 300 more off the computer ...

    Hi,

        

    You can make use of the command Cacls to aid you.

        

    Here is an example, if you are running the batch file manually using your own account:

              Cacls "C:\Documents and Settings\studenths" /e /d <domain\account>

              <Add the cacls command (with /e /d switch) for all other profiles that you wish to save>

              "C:\Program Files\Windows Resource Kits\Tools\delprof.exe" /q /d:<days>

              Cacls "C:\Documents and Settings\studenths" /e /r <domain\account>

              <Add the cacls command (with /e /r switch) for all other profiles that you have added above>

       

    The /e switch edits the DACL instead of replacing it. 

    The /d switch will deny access for the specified user.

    The /r switch will revoke the access rights for the specified user.

        

    You may refer to this article, Cacls, for further information.

        

    Hope that helps.

        

    Cheers,


    Tas Chew

    Thursday, October 24, 2013 5:02 AM
  • There is a script for this :
    Const LocalDocumentsFolder = "C:\Documents and Settings\"
    
    set objFSO = createobject("Scripting.FileSystemObject")
    set objFolder = objFSO.GetFolder(localdocumentsfolder)
    
    on error resume next
    
    for each fldr in objFolder.SubFolders
    	if not isexception(fldr.name) then
    		objFSO.DeleteFolder fldr.path, True
    	end if
    next
    
    
    Function isException(byval foldername)
    	select case foldername
    		case "All Users"
    			isException = True
    		case "Default User"
    			isException = True
    		case "LocalService"
    			isException = True
    		case "NetworkService"
    			isException = True
    		case "Administrator"
    			isException = True
    		case Else
    			isException = False
    	End Select
    End Function
    


    Arnav Sharma | Facebook | Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, October 24, 2013 5:44 AM
    Moderator
  • Hi Arnav,

        

    Delprof.exe is command line utility that allows users to delete user profiles on a local or remote computer running on Windows 2000, Windows XP, and Windows Server 2003.

        

    It can be downloaded from this link: User Profile Deletion Utility

        

    While your script is able to delete the user profile from the local harddisk, it does not clear stored user profile information in the registry. Delprof.exe does.

        

    Hope this explains the difference.


    Tas Chew

    • Edited by Tas76 Thursday, October 24, 2013 6:22 AM
    Thursday, October 24, 2013 6:17 AM
  • Okay. Thanks.

    I just gave the script to del. the profiles.


    Arnav Sharma | Facebook | Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, October 24, 2013 9:34 AM
    Moderator