On Windows 10, using the Windows Management Instrumentation Command Line (WMIC), you can set the password never to expire with the command:
WMIC UserAccount WHERE NAME='username' SET PasswordExpires=FALSE
Note that you have to run the command from an elevated command prompt window.