Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for deldeadprofiles.bat

(view source code of deldeadprofiles.bat as plain text)

  1. @ECHO OFF
  2. :: DelDeadProfiles, Version 1.00 for Windows NT
  3. :: Removes unused leftovers of corrupted profiles for the current user ID.
  4. :: If the current user profile is C:\WINNT\Profiles\userid.000 then both
  5. :: C:\WINNT\Profiles\userid and C:\WINNT\Profiles\userid.002 will be
  6. :: removed.
  7. :: Written by Rob van der Woude
  8. :: http://www.robvanderwoude.com
  9.  
  10. CALL :CheckIfCorrupt %userprofile%
  11. GOTO:EOF
  12.  
  13. :CheckIfCorrupt
  14. FOR /D %%A IN (%~dpn1.*) DO CALL :DelDeadProfiles %%A %userprofile%
  15. GOTO:EOF
  16.  
  17. :DelDeadProfiles
  18. if not [%~f1]==[%~f2] echo Deleting corrupted profile %~nx1 . . .
  19. if not [%~f1]==[%~f2] rd /s /q %1
  20. goto:EOF
  21.  

page last modified: 2024-04-16; loaded in 0.0074 seconds