I recently ran a program that automatically generates 500 users on a virtual machine, and it is making it lag on the lockscreen. Basically, it generates 500 users in the format of: "userX (user1, user2, user3 etc.). I was wondering if there could be a batch script / powershell script / just anything that could be done to remove all of these users. The process can be done manually using net user userX /del
but it could probably be automated using the same command again but with numbers counting up. Thanks.
Asked
Active
Viewed 33 times
-1

user123
- 31
- 5
1 Answers
0
for /L %a in (1,1,500) do @net user user%a /del
Or if in a batch file:
for /L %%a in (1,1,500) do @net user user%%a /del

Anders
- 97,548
- 12
- 110
- 164