chiners_68 Posted January 5, 2007 Posted January 5, 2007 Hi Guys, i need some assistance on the best way to do the job below with autoit. basically I want to delete all the profiles on an XP machine but keep the Default user/ all user & logged in users profile. what would be the best way to do this..?
MadBoy Posted January 5, 2007 Posted January 5, 2007 Hi Guys, i need some assistance on the best way to do the job below with autoit. basically I want to delete all the profiles on an XP machine but keep the Default user/ all user & logged in users profile. what would be the best way to do this..? Not sure if that's the best way but i guess it will work ;P Before replacing MsgBox with DirRemove THINK/TEST etc ;p i am not responsible for your losses ;p #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("C:\Documents and Settings") If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf ;_ArrayDisplay($FileList,"$FileList") For $i = 1 To $Filelist[0] If $Filelist[$i] = "All Users" OR $Filelist[$i] = "Default User" OR $Filelist[$i] = @UserName OR $Filelist[$i] = "LocalService" OR $Filelist[$i] = "NetworkService" Then ; Do nothing here Else If MsgBox(1, "Are you sure?", "Dir for user " & $Filelist[$i] & " is about to be deleted..") = 1 Then ; Add deletion command here, replace MsgBox with DirRemove. SHould work MsgBox(0,"test","C:\Documents and Settings\" & $Filelist[$i]) ;DirRemove("C:\Documents and Settings\" & $Filelist[$i],1) EndIf EndIf Next My little company: Evotec (PL version: Evotec)
sugi Posted January 5, 2007 Posted January 5, 2007 Also have a look at this registry key: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
chiners_68 Posted January 5, 2007 Author Posted January 5, 2007 cheers guys for your help... ive found a tool which microsoft has DelProf.exe which removes profiles doing the job I wanted. /q command dosent seem to work but ive got round this with Autoit by piping the y & enter.. cheers
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now