I'm using the batch file below to backup certain profile information. I need to have a routine within the batch file that will delete the folders older than a certain date beneath the %user% folder (say, older than 30 days, etc...) . Thanks in advance for any assistance.
Mark
==========================
==========
==========
==========
@echo off
::::::::::::::::::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
:::::
::::::::::: THIS BATCH FILE BACKS UP SPECIFIC INFO FROM USER PROFILES ::::::::::::::::::::::::::
:::::
::::::::::: The \\Srbpnas\Support\ProfileB
ackups\Com
puterList.
txt file ::::::::::::::::::::::::::
::::::::::: must be populated with the PC and user names. ::::::::::::::::::::::::::
::::::::::
::::::::::::::::::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
::::::::::
:::::
for /f "tokens=1,2" %%a in (\\Srbpnas\Support\Profile
Backups\Co
mputerList
.txt) Do call :process %%a %%b
goto :eof
:process
:: variables
set computer=%1
set user=%2
set drive=\\Srbpnas\Support\Pr
ofileBacku
ps
set backupcmd=xcopy /s /c /d /e /h /i /r /y
:: Begin Individual User----------------------
----------
----------
----------
---
echo ### Backing up NK2 Files...
%backupcmd% "\\%computer%\c$\Documents
and Settings\%user%\Applicatio
n Data\Microsoft\Outlook" "%drive%\%user%\%date%_%co
mputer%_NK
2"
echo ### Backing up Normal.dot Files...
%backupcmd% "\\%computer%\c$\Documents
and Settings\%user%\Applicatio
n Data\Microsoft\Templates" "%drive%\%user%\%date%_%co
mputer%_Te
mplates"
echo ### Backing up Favorites...
%backupcmd% "\\%computer%\c$\Documents
and Settings\%user%\Favorites"
"%drive%\%user%\%date%-%co
mputer%_Fa
vorites"
::End Individual User----------------------
----------
----------
----------
------
echo Backup Complete!
Start Free Trial