Sign in to follow this  
Followers 0
itguy31

Deleting Profiles

4 posts in this topic

Ok guys I am fairly new to AutoIT so dont laugh. What I am trying to do is write a script that will look in c:\users and remove all folders except for the public and admin folders AS WELL AS look in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Profilelist and delete all registry entries for those folders but leave certain ones. I assume this is probably a complex script. Any help would be GREATLY appreciated.

Rick

Share this post


Link to post
Share on other sites



Doesn't sound too complex.

To delete directories use functions FileFindFirstFile, FileFindNextFile, FileGetAttrib and FileDelete

To delete registry entries use RegDelete.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hey Rick,

if you are familiar with handling arrays I'd prefer using _FileReadToArray over FileFindXXX Functions.

As water said, you can delete registry items with RegDelete, but how do you list all Keys under a special key? :)

That's an interesting question.

Edit:

Well, I guess you could use "regedit /e" to export a list of keys... :)

Edited by Hannes123

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

In Regedit, all the local profiles dont have a GUID attribute. When the computer builds the profile from the domain it is given a GUID attribute in which I could narrow the search to i believe. Anything in Profile List with a GUID attribute could be deleted with the exception of tasks because that is our antivirus. I will tinker around and see what I can start with. Thanks for the input. Please keep it coming.

Rick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0