1.

Solve : Delete All Users Local Settings/Application Data?

Answer»

Our organization has sever applications that install cache and settings under the "C:\Documents and Settings\%Userprofile%\Local Settings\Application Data" directory. This is fine and dandy' until the application has an issue and need to be completely installed and REINSTALLED. At this point the cache and user file are sometimes left behind. I would like to find an easy efficient way of removing these directories.
In the past we have not had more than 1 user to deal with so it was a simple install then remove the cache files however, we recently implemented a few workstations in a facility that uses a domain and has over 20 users that rotate through, all the users have login's. Which is where I run into a problem...
I have yet to see an easy way around this that does not involve opening each individual user profile and navigating to the files in question and deleting them. What I would really like is a batch file I could run that would delete these directory's, but cant for the life of me figure out how to write it. SOMETHING like the following would be perfect but either my syntax is wrong or I just lack the experience with batch files:

del C:\Documents and Settings\%UserProfile%\Local Settings\Application Data\"files in question"
del C:\Documents and Settings\%UserProfile%\Application Data\"files in question"

I have EVEN toyed with the notion of running two separate programs, one to query the "Documents and Settings" directory for all of the users that would dump to a .txt, then a second program that would query that .txt and remove the directories based on what is in the .txt.

Anyone that can help please do. I can LIVE if there is no easy way, but it would probably save me a few hours over the next couple of months.,


C:\>type appdata.bat
Code: [Select]@echo off

cd %userprofile%/Application Data/

dir *.txt

rem del *.txt
Output:


C:\> appdata.bat
Volume in drive C has no label.
Volume Serial Number is F4A3-D6B3

Directory of C:\Documents and Settings\Bill Richardson\Application Data

01/23/2010 12:43 PM 8 user.txt
1 File(s) 8 bytes
0 Dir(s) 303,193,333,760 bytes free

C:\Documents and Settings\Bill Richardson\Application Data>All Users i believe would not be a workable approach as it becomes a protected system file.

Maybe using an APP before the fact (or install) would be beneficial such as Total Uninstall...
It takes a snapshot of all files and folders created/changed on installation including the registry and thus when an app is uninstalled it removes all remnants of that app including cached and temp files.



Discussion

No Comment Found