![]() |
want solution.. - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Computers (https://sinister.ly/Forum-Computers) +--- Forum: Antivirus & Protection (https://sinister.ly/Forum-Antivirus-Protection) +--- Thread: want solution.. (/Thread-want-solution) |
want solution.. - EVILKING - 12-03-2011 can anybody reverse this batch code for me... Code: @echo off RE: want solution.. - ArkPhaze - 12-03-2011 What do you mean by "reverse" are you saying you ran this batch and you want a reverse method? RE: want solution.. - EVILKING - 12-03-2011 (12-03-2011, 08:17 AM)Infinity Wrote: What do you mean by "reverse" are you saying you ran this batch and you want a reverse method? using this code i am able to make so many accounts with admin rights..but if i want to delet it all then what i have to do?? RE: want solution.. - ArkPhaze - 12-03-2011 I could do this easily in powershell to get rid of those dead accounts with the exception of the main ones. But if you want it completely in batch i'd have to make a test script for myself. RE: want solution.. - ArkPhaze - 12-03-2011 Here's my powershell script to delete ALL user accounts that don't match the current user account you're logged into along with the "Administrator" and "Guest" account. This will output to del_users.txt a list, line by line of the user names it has attempted to delete, and don't match the current $user and "Administrator" and "Guest" Code: $Comp = "." What i'm doing here is taking data from the WMIObject class "Win32_UserAccount" and returning values ONLY for the User strings. If they don't match my current user account name, and "Administrator" and "Guest" then it adds it to a text file called "del_users.txt" on a new line. Then after that loops through, we create a hash array getting the full string of the content in that created file, and add each line as a string item to the hash array defined as $del_array. Now we look at each object/string value in that array and apply the net users /del command line method to that specific username. Therefore removing all the useless user accounts except for the main ones that should be on your machine. RE: want solution.. - esque - 12-03-2011 HMmmmmmmmm............................................................................... RE: want solution.. - ArkPhaze - 12-03-2011 (12-03-2011, 10:16 AM)esque Wrote: HMmmmmmmmm............................................................................... What's this for? Btw, if anyone wants to know more about powershell, i'm your guy to talk to if you need any help, or advice. The above script I wrote is tested and working for deleting random user accounts. |