Solved

Batch Script to delete windows 7 user profiles on network PCs

Posted on 2014-11-05
6
1,623 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now