+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
Windows Thread, Batch File Needed??- Profile Problem in Technical; HI Can any one tell me what commands to use to run a bat file to delete C:\Documents and Settings ...
  1. #1
    Techdw's Avatar
    Join Date
    Jan 2009
    Posts
    156
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Batch File Needed??- Profile Problem

    HI

    Can any one tell me what commands to use to run a bat file to delete C:\Documents and Settings in XP, if poss not delete all users and administrator and so on. Iv tried a few i found on the net bout they dont work.

    Some times students cant log back into the same computers and comes up with this;

    Windows cannot copy file \\DOMAIN NAME\NETLOGON\PROFILE NAME\Local Settings\Temporary Internet Files\Content.IE5\CXSEFUAE\afe%253Dactive%2526sa%2 53DX%2526gbv%253D2%2526tbs%253Disch%3A1;ce=1;je=1; sr=1440x900x32;dg=E10094-W-MS-8;dst=1;et=1267108058677;tzo=0;a=p-36POJYHTosuxU[1].gif to location C:\Documents and Settings\USERNAME\Local Settings\Temporary Internet Files\Content.IE5\CXSEFUAE\afe%253Dactive%2526sa%2 53DX%2526gbv%253D2%2526tbs%253Disch%3A1;ce=1;je=1; sr=1440x900x32;dg=E10094-W-MS-8;dst=1;et=1267108058677;tzo=0;a=p-36POJYHTosuxU[1].gif. Possible causes of this error include network problems or insufficient security rights. If this problem persists, contact your network administrator.

    DETAIL - The filename or extension is too long.


    Iv hit a dead end on this any help,

    If i could run a bat file to just delete all profiles on log off that would be good.

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,807
    Thank Post
    3,320
    Thanked 1,056 Times in 977 Posts
    Rep Power
    365
    delprof ???

    That or add the users to the guest group - by design it will remove the profile on log out.

  3. #3
    round2it's Avatar
    Join Date
    May 2009
    Location
    UK
    Posts
    1,016
    Thank Post
    199
    Thanked 148 Times in 105 Posts
    Rep Power
    38
    use a combination of delprof and the user hive profile clean tool from microsoft

    delprof is well documented on here

    Overview
    The User Profile Hive Cleanup service helps to ensure user sessions are completely terminated when a user logs off. System processes and applications occasionally maintain connections to registry keys in the user profile after a user logs off. In those cases the user session is prevented from completely ending. This can result in problems when using Roaming User Profiles in a server environment or when using locked profiles as implemented through the Shared Computer Toolkit for Windows XP.

    On Windows 2000 you can benefit from this service if the application event log shows event id 1000 where the message text indicates that the profile is not unloading and that the error is "Access is denied". On Windows XP and Windows Server 2003 either event ids 1517 and 1524 indicate the same profile unload problem.

    To accomplish this the service monitors for logged off users that still have registry hives loaded. When that happens the service determines which application have handles opened to the hives and releases them. It logs the application name and what registry keys were left open. After this the system finishes unloading the profile.

  4. #4
    Techdw's Avatar
    Join Date
    Jan 2009
    Posts
    156
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Is there no way of just making a BAT file to delete?? with some commands, I just dont know what ones.

  5. #5


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 434 Times in 353 Posts
    Rep Power
    126
    Knock yourself out,

    Windows XP Commands

  6. #6
    TheLibrarian
    Guest
    You could use a batch file, however the delprof command is exactly what you want already.

    Indeed just run it with the /i /q switches.

    Seriously that is all you need.

  7. #7
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,513
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68
    Why try to re-write something that is already there and works perfectly well, probably better than anything you will be able to make using batch anyway, what have you got to prove, that you can script in cmd?

    Just use delprof!

    EDIT: I've got one for you....


    @ECHO OFF
    :START
    ECHO YOUR DAFT...STOP TRYING TO CREATE WORK FOR YOURSELF BY RE-WRITING DELPROF!
    GOTO START

    No seriously though, you do know that you want to be deleting the folders inside Docs and Setts not the Docs and Setts folder itself.

    D
    Last edited by danrhodes; 26th February 2010 at 09:32 AM.

  8. #8
    Techdw's Avatar
    Join Date
    Jan 2009
    Posts
    156
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    LOL!!.

    Ok with delprof, could you go through it how to set it up to suto delete, without going round each pc please.
    I ran it on one PC and it comes up with delete all INACTIVE profiles?? I want it to delete every single one

  9. #9
    tech-man's Avatar
    Join Date
    Jul 2005
    Location
    The Pub
    Posts
    171
    Thank Post
    13
    Thanked 16 Times in 11 Posts
    Rep Power
    21
    I use a VBS script which is available at WiseSoft - Resources for IT Professionals it's called "Delete Local Profiles". You can add exceptions to the script.

  10. #10

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Are you running mandatory profiles - it looks like it from the server location and the fact that this is a logon message.

    Assuming that is the case, the problem isn't that you've got old profiles on the workstation but you've got rubbish in your server copy of the profile.

    On the server, go to the profile folder (c:\windows\sysvol etc) and delete the "local settings" folder completely

    What it looks like is happening is that you've set up a profile at some point in the past, copied it to the server so that your users can use it but you've included all the stuff that's not intended to be on the server (that's kind of why it's called "local settings")

  11. #11
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,205
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    As stated above delprof should work, we ended up using this ages ago I can't even remember why now but it works very well. We set it to run at start up, simply add users that you DON'T want deleting to the 'Call DeleteFolders' line. Save it as a .vbs file and put it in netlogon.

    Code:
    ' Deletes local profiles from hard disk at MACHINE STARTUP this prevents logon problems when the profile is copied from the 'server
    
    On Error Resume Next
    
    Sub DeleteFolders(strRoot, strExclude)
    
    On Error Resume Next
    
     	Dim fso, f, fc, folder, arrExcl, folderName, folderPath, i, isExcl
    
    	arrExcl = Split(strExclude, ",")
    	
       	Set fso = CreateObject("Scripting.FileSystemObject")
       	Set f = fso.GetFolder(strRoot)
    	For Each folder in f.SubFolders
    
    		folderName = LCase(folder.name)
    		folderPath = LCase(folder.path)
    
    		isExcl = False
    
    		i = 0
    		Do While i < UBound(arrExcl) + 1
    	
    			If Lcase(arrExcl(i)) = folderName Then 
    				isExcl = True	
    			End If
    
    		i = i + 1
    		Loop	
    
    		If isExcl = False Then
    			fso.DeleteFolder folderPath, True
    		End If	
    		
    	Next   
    End Sub
    
    
    Call DeleteFolders("c:\documents and settings\", "administrator,All Users,Default User,NetworkService,LocalService")
    
    'Usage: DeleteFolders("full path to folder, ending in \", "list of folders to be excluded, separated by a comma, no slashes")

  12. #12
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,205
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    Anyone here launch a delprof script that reads a list of PC's from a text file? Care to share the command to launch this, i've followed this link but it doesn't seem to work i've prob just got the syntax wrong.

    The Easy Way to Delete Unused Profiles

  13. #13
    Techdw's Avatar
    Join Date
    Jan 2009
    Posts
    156
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Forgot to say running .MAN profiles

  14. #14
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,527
    Thank Post
    107
    Thanked 89 Times in 75 Posts
    Blog Entries
    46
    Rep Power
    40
    Quote Originally Posted by Techdw View Post
    Is there no way of just making a BAT file to delete?? with some commands, I just dont know what ones.
    we use

    c:\> For /f %a in ('net view ^| find "<prefix>" /i') do delprof /c:%a /q /i

  15. #15

    Join Date
    Mar 2007
    Location
    Central Scotland
    Posts
    829
    Thank Post
    12
    Thanked 8 Times in 8 Posts
    Rep Power
    19
    I just have the logon script removing any temp and temp internet files at logon from both local PC and server profile area as well as stopping them syncing using group policies (although doesn't always seem to work on older domains).

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Batch file to copy user profile
    By googlemad in forum Windows
    Replies: 2
    Last Post: 15th October 2010, 11:08 PM
  2. Batch File (select random file) help
    By fil_b in forum Windows Server 2000/2003
    Replies: 5
    Last Post: 5th November 2009, 04:13 AM
  3. batch to bash rewrite help needed please
    By RabbieBurns in forum Scripts
    Replies: 4
    Last Post: 22nd September 2008, 09:05 AM
  4. batch file comman
    By jussy65 in forum Scripts
    Replies: 3
    Last Post: 13th August 2008, 07:10 AM
  5. batch file help
    By beeswax in forum Scripts
    Replies: 9
    Last Post: 3rd March 2006, 07:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •