I've written a few batch files before, but this one I'm a little stuck on.
Some of our computers that we inherited haven't been imaged since 2007, but they are running fine (albiet slowly). I looked and they have 40, 50, sometimes up to 80 cached profiles (in "Documents and Settings") from old users that don't exist anymore.
Is there a quick and easy way (using the built-in windows commands, rmdir, del, etc) to remove all profiles older than n? Some of them are pretty big and it takes too long to do it manually.
Obviously I'd need to exclude the Administrator folder.
I was thinking something like
set EXCLUDED_PROFILE=Administrator
rmdir /s /q *
Some of our computers that we inherited haven't been imaged since 2007, but they are running fine (albiet slowly). I looked and they have 40, 50, sometimes up to 80 cached profiles (in "Documents and Settings") from old users that don't exist anymore.
Is there a quick and easy way (using the built-in windows commands, rmdir, del, etc) to remove all profiles older than n? Some of them are pretty big and it takes too long to do it manually.
Obviously I'd need to exclude the Administrator folder.
I was thinking something like
set EXCLUDED_PROFILE=Administrator
rmdir /s /q *