batch file net use comand to delete users

January 8, 2010 at 09:00:01
Specs: Windows XP

HI guys I have xp pro operating sys in my office where workers are registered. There are 250 users in the computer. their account names begin with amanizz followed by numbers 1-1000 eg-(Amanizz145,Amanizz70..). So please help me on how to create a batch file to delete these accounts from my computer. here is the cod I used
net use amanizz145 /delete
TNX for ur time

See More: batch file net use comand to delete users

Report •


#1
January 8, 2010 at 13:38:11

Post this in the Programming Forum. Link is on right

Home Page http://ewen.uuuq.com/


Report •

#2
January 9, 2010 at 04:59:28

TNX, but I kind of need it fast, besides I have to register. I am surly hopeful some one a member of this site could help me

Report •

#3
January 18, 2010 at 12:21:55


I think this script will work.

We will declare an integer variable ($index) and loop it thru 1-1000. We will then compose the 'net use' command which you specified (thanks for specifying it) in the loop to delete the $index'th user. Finally, we will pass the composed 'net use' command to the operating system for execution.

Here is the code -




# Script DeleteUsers.txt
var integer index
set $index = 1
while ( $index <= 1000 )
do
    var string command
    set $command = "net use amanizz"+makestr(int($index))+" /delete"
    system -s $command
    set $index = $index + 1
done


Script is in biterscripting ( http://www.biterscripting.com ). Save the script in file "C:/Scripts/DeleteUsers.txt", start biterscripting and enter the following command.


script "C:/Scripts/DeleteUsers.txt"

Test the script first on test data. I have not tested it.



Report •

Related Solutions

#4
January 19, 2010 at 00:03:20

Men I don't know how to thank you. you solved my problem 100%. thank you. you are the best.

Report •


Ask Question