Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Batch Script to delete windows 7 user profiles on network PCs

Posted on 2014-11-05
6
Medium Priority
?
3,605 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 36

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
AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

 
LVL 36

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 1500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

670 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