To prevent password expiration every 42 days: 1)
@echo off wmic useraccount set PasswordExpires=false
To rename user from command prompt: 2)
wmic useraccount where name='currentname' rename newname
Using this command we can rename administrator account also. The below command changes the user name from ‘administrator’ to ‘admin.’
wmic useraccount where name='administrator' rename admin