批处理取消windows账户密码永不过期前的对勾
以管理员权限执行
修改计算机账户信息,以及取消账户前的密码永不过期的对勾。
@echo off
for /f "skip=4 tokens=1-3" %%i in ('net user') do (
if not "%%i" == "命令成功完成。" echo %%i >>c:\tempuser.txt
if not "%%j" == " " echo %%j >>c:\tempuser.txt
if not "%%k" == " " echo %%k >>c:\tempuser.txt
)
echo.
echo current login account is;%username%
@echo ping 127.0.1 -n 2 >nul
for /f "eol=E tokens=1 " %%l in (c:\tempuser.txt) do (
if not "%%l" == "Administrator" net user %%l 123
)
@echo ping 127.0.1 -n 2 >nul
for /f "eol=E tokens=1 " %%m in (c:\tempuser.txt) do (
if not "%%m" == "Administrator" wmic USERACCOUNT where name="%%m" set PasswordExpires=true
)
@echo ping 127.0.1 -n 2 >nul
del c:\tempuser.txt