Scripting Deletion of User Profiles - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Closed Thread
Thread Tools Display Modes
Old 07-09-2004, 01:19 PM   #1 (permalink)
Newb Techie
Join Date: Jul 2004
Posts: 9
Default Scripting Deletion of User Profiles

I am writing a script to delete the user profile folders under "c:\Documents and Settings\<username>." The script will not work on profile folders created automatically by Windows. I can, as an Administrator, right-click on the folder and delete it, but running the script under Administrator will not work. I used Group Policy to have the script run as a starup script having SYSTEM privilages and that did not work either. To test that the script works, I created a folder under "c:\Documents and Settings\<username>" and ran the script against it and it was deleted (but this was a folder I manually created). I would assume that there are some permissions problems with having the script take care of this task. Another little thing about what I'm trying to do is that I'm trying to delete only certain profiles. I work for a school district and all of our students are referenced by a numerical student ID in the Active Directory. When the profiles are created they have numerical profile folder names. I am using Visual Basic Script to try and delete these on a regular basis. There, however, is some type of issue in having a script do this. I tried to use the delprof.exe tool that comes with Win2k and WinXP, but there is no way to have that delete only numeric profiles. I even tried having the scrip work with delprof.exe but it still is indiscrimnant about what it deletes. The cause for automation is a just one--with 15,000 users some of the machines can have up to 80 profiles that otherwise must be manually deleted (very time consuming). Sometimes the students use them only once, leaving a profile that is around 5-7MB in size to take up nothing but disk space. I've already done extensive research on this and have tried everything that I thought of and uncovered, but all to no avail. Any help would be greatly appreciated.

pachecod is offline  
Old 07-12-2004, 03:02 PM   #2 (permalink)
Newb Techie
Join Date: Jul 2004
Posts: 9

'3:15 PM 6/14/2004 Script to change the local administrator password on each local machine.

strComputer = "."
Set objUser = GetObject("WinNT://" & strComputer & _
objUser.SetPassword "newpassword1"
pachecod is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities

Copyright 2002-2015 Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 06:47 PM.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2016, vBulletin Solutions, Inc.