China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-06 23:34
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Need a script to delete extra system accounts View 1,841 Replies 18
Floor 16 Posted 2007-12-17 22:19 ·  中国 上海 杨浦区 电信
高级用户
★★★
Credits 916
Posts 377
Joined 2004-03-08 00:00
22-year member
UID 19523
Gender Male
Status Offline
Whew, that totally went over my head,

to everest79, could you write a piece of code? Thanks.
Floor 17 Posted 2007-12-17 22:38 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Floor 18 Posted 2007-12-17 22:46 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
for /f "skip=1" %i in ('wmic useraccount get name^|more') do find "%i" userlist.ini||net user /delete "%i"

I tested this and it can completely delete full-width-character accounts.
Floor 19 Posted 2007-12-17 22:51 ·  中国 上海 杨浦区 电信
高级用户
★★★
Credits 916
Posts 377
Joined 2004-03-08 00:00
22-year member
UID 19523
Gender Male
Status Offline
Yeah, thanks everyone for the enthusiastic help. There's still a lot of stuff I can't understand , too much stuff to learn. Special thanks to the two moderators, 3Q

Enumerating User Accounts on the Local Computer
http://www.microsoft.com/china/technet/community/scriptcenter/user/scrug148.mspx

How Can I Save Output to a Text File?
http://www.microsoft.com/china/technet/community/scriptcenter/resources/hey0817.mspx
Forum Jump: