Link to home
Start Free TrialLog in
Avatar of lianne143
lianne143Flag for United States of America

asked on

Batch Script to delete windows 7 user profiles on network PCs

Hi
We have windows 7 PC and the user profiles are getting populated on the C:\users\ and very soon the C drive will be full.

I saw the attached batch file on the internet (Windows 7 User Profile Cleaning) and I want to try on one of the Windows 7 PC locally before I actually apply on the GPO  under:
(Computer configuration-policies- windows settings-Scripts-shutdown)

Please post me some tutorials as how to test this batch file on a local computer to see if it deletes the user profiles on a window 7 PC
Please remove any line \amend the script if required and any help will be grateful.
ProfileDelete.txt
Avatar of Kimputer
Kimputer

This file is meant to be run locally. Therefore, use a Windows 7 PC, where you backed up the user profiles already. Then log in as the administrator and just run this batch file.
Avatar of lianne143

ASKER

I logged in as a administrator  and  copied this batch file to C:\users  and when double clicked.
I saw a command prompt windows appearing and disappearing very quickly and on the window it says:
"Skipping user clean for administrator. Domain"

Thanks
It doesn't delete  any user profiles that are populated.
The script uses a few ECHO commands and also a report on file. What do these say?
ASKER CERTIFIED SOLUTION
Avatar of ThomasMcA2
ThomasMcA2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As a side note, just deleting the user folder will not totally remove reference to the users profile as it did under XP. You also need to delete the users profile listed in the registry as well..

HKLM\software\Microsoft\Windows NT\CurrentVersion\ProfileList

If you do not do this the user will get a message stating they are logged in with a temp profile