Jump to content

Deleting Profiles


Recommended Posts

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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]
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...