Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

How to create a never expiring password & user via net user through .bat file

Solution 1:

Add this line to the batch file:

WMIC USERACCOUNT WHERE "Name='%1'" SET PasswordExpires=FALSE

Solution 2:

The option /expires is for account, not for password, check the command help.

http://support.microsoft.com/kb/251394/en-us

From the documentation: "Causes the user account to expire if you specify the date."

Tags:

Windows

Batch

Related

Why can host and nslookup resolve a name but dig cannot? yum update, how to make rpm package updateable Nginx https rewrite turns POST to GET Correct way to move kvm vm How can I install git on RHEL 6? How can I tell if Windows is running in Safe Mode? How to use "Instance Store Volumes" storage in Amazon EC2? HTTP/1.1 Status Codes 400 and 417, cannot choose which What is the right iptables rule to allow apt-get to download programs? How do I change the NGINX user? Does Amazon EC2 and RDS have ECC memory? How can I debug nginx further than the error log?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy