- 帖子
- 2
- 积分
- 14
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2021-12-15
|
[其他] 自动批处理修改域中每台电脑的本地管理员密码
@echo on
if exist \\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt goto _end
echo %date% %time% >\\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt
echo %computername:~0,40% >>\\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt
for /f "tokens=1,2* delims=:" %%a in ('ipconfig ^|findstr "IP Address"') do set ip=%%b
echo %ip%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt
echo %ip:~9,40%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt
echo @aaa20210705%ip:~9,40%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt
net user administrator @aaa20210705%ip:~9,40%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\%computername:~0,40%.txt
echo %date% %time% %computername:~0,40% %ip% @aaa20210705%ip:~9,40%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\change.txt
rem echo %computername:~0,40%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\change.txt
rem echo %ip%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\change.txt
rem echo @aaa20210705%ip:~9,40%>>\\aaaks.com\SysVol\aaaks.com\userpasswd\change.txt
:_end
已知以上代码为自动批处理修改域中每台电脑的本地管理员为不同的密码
请大神分段分析下以上代码,谢谢。 |
|