代码以自动删除最终具有1-500号数字的用户

发布于 2025-02-13 16:33:31 字数 229 浏览 1 评论 0原文

我最近运行了一个程序,该程序会在虚拟机上自动生成500个用户,并且它使其滞后在锁屏上。基本上,它以:“ Userx(user1,user2,user3等)的格式生成500个用户。我想知道是否可以有一个批处理脚本 / powerShell脚本 /只是可以采取任何措施以删除所有这些用户。该过程可以使用NET USERX /DEL < /code>手动完成,但是它可能会再次使用同一命令自动化,但要计算数字。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

平安喜乐 2025-02-20 16:33:31
for /L %a in (1,1,500) do @net user user%a /del

或在批处理文件中:

for /L %%a in (1,1,500) do @net user user%%a /del
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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文