Interactive script to delete user Win 7 profiles and specific folder in user my documents on server
Posted on 2012-09-02
We have the requirement for a batch file / vbscript that can be run interactively - essentially what I would like is a prompt for a username, and the script deletes all the files and folders inside the stored v2 profile on a Windows DC as well as deletes all the files and folders inside a specifc folder we use (and is the same for every user- apart from server name and username) for roaming Windows 7 settings. Some logging would be great as well - i.e. a record of who ran what at what time - (what user was deleted etc.)
We have 5 DCs, with our user profiles and work areas stored across all of them. All our users have a hidden share - \\servername\username$ which is their work area. Inside this folder are the Windows 7 roaming settings ( a couple of folders beneath the root username$ folder) The v2 profiles are stored in a folder path - \\servername\UserProfiles\YearGroup\<username>.v2
If you require any other information - I will provide it.
The reason for wanting this is we need a quick method to delete user v2 profiles as well as removing windows 7 settings to assist troubleshooting our new Windows 7 machines on the domain.