Solved

Batch Script to delete windows 7 user profiles on network PCs

Posted on 2014-11-05
6
2,765 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 20

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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

739 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