Solved

Batch Script to delete windows 7 user profiles on network PCs

Posted on 2014-11-05
6
2,304 Views
Last Modified: 2014-11-09
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
0
Comment
Question by:lianne143
6 Comments
 
LVL 35

Expert Comment

by:Kimputer
ID: 40423641
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.
0
 

Author Comment

by:lianne143
ID: 40423660
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
0
 

Author Comment

by:lianne143
ID: 40423663
It doesn't delete  any user profiles that are populated.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 35

Expert Comment

by:Kimputer
ID: 40423675
The script uses a few ECHO commands and also a report on file. What do these say?
0
 
LVL 14

Accepted Solution

by:
ThomasMcA2 earned 500 total points
ID: 40423905
It doesn't log anything to a text file unless you happen to have a file called t:\labreport.txt.

To see the output of the echo commands, you need to run the script from a command prompt. Follow these steps:

Start menu > All Programs > Accessories > Command prompt > type cd c:\users > press Enter > type the name of the batch file > press Enter
0
 
LVL 19

Expert Comment

by:compdigit44
ID: 40427397
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
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question