Batch file to delete *.oab in all profiles on workstation

Answered Batch file to delete *.oab in all profiles on workstation

  • Thursday, February 14, 2013 6:11 PM
     
     

    Trying to write a batch file that will delete the *.oab from all users profiles on a workstation.  The path is below:

    C:\Documents and Settings\%userprofile%\Local Settings\Application Data\Microsoft\Outlook\*.oab

    would like it to delete the *.oab files from all profiles on the workstation

All Replies

  • Thursday, February 14, 2013 6:19 PM
    Moderator
     
     Answered

    This path implies WinXP or earlier and not Vista, or Win 7/8, right?

    Assuming the folders are not encrypted, this should work ...

      for /D %%F in ("C:\Documents and Settings\*\Local Settings\Application Data\Microsoft\Outlook\") do del %%F\*.oab /f

    See the FOR/? help for an explanation of why this will work.


    Tom Lavedas