Skip to content

What is CHGLOGON Windows command?

The Windows chglogon command enables users to change user logon information effortlessly. This command allows users to modify usernames and passwords with ease. By utilizing the chglogon command, users can update their login details quickly and effectively. This feature provides a convenient way to manage user credentials within the Windows operating system. Ultimately, the chglogon command offers a seamless solution for users looking to modify their logon information without any hassle.

Terminal window
chglogon [enable|disable]
OptionDescription
enableEnables automatic logon
disableDisables automatic logon
ParameterDescription
enableEnables automatic logon with the specified user
disableDisables automatic logon
Terminal window
chglogon /random "Welcome to My Computer"

Changes the logon prompt message to “Welcome to My Computer”.

Terminal window
chglogon /random ""

Resets the logon prompt message to the default message.

Terminal window
chglogon /query

Displays the current logon prompt message.

Set Logon Prompt Message with Specific Text

Section titled “Set Logon Prompt Message with Specific Text”
Terminal window
chglogon /random "Enter your credentials to access the system."

Sets a custom logon prompt message as “Enter your credentials to access the system.”

Terminal window
chglogon /disable

Disables the logon prompt message displayed during logon.

To use the chglogon command in CMD, execute the following command:

Terminal window
chglogon --logoff

What is the purpose of the chglogon command in Windows CMD?

Section titled “What is the purpose of the chglogon command in Windows CMD?”

The chglogon command in Windows CMD is used to change the logon options for a user session.

How can I logoff a user session using the chglogon command in CMD?

Section titled “How can I logoff a user session using the chglogon command in CMD?”

To logoff a user session using the chglogon command in CMD, you can use the following command:

Terminal window
chglogon --logoff

How do I switch users using the chglogon command in CMD?

Section titled “How do I switch users using the chglogon command in CMD?”

To switch users using the chglogon command in CMD, you can use the following command:

Terminal window
chglogon --switchuser

Can I lock a user session using the chglogon command in CMD?

Section titled “Can I lock a user session using the chglogon command in CMD?”

Yes, you can lock a user session using the chglogon command in CMD by executing the following command:

Terminal window
chglogon --lock

How do I unlock a locked user session with the chglogon command in CMD?

Section titled “How do I unlock a locked user session with the chglogon command in CMD?”

To unlock a locked user session using the chglogon command in CMD, you can use the following command:

Terminal window
chglogon --unlock

Can I change the password for a user session using the chglogon command in CMD?

Section titled “Can I change the password for a user session using the chglogon command in CMD?”

Yes, you can change the password for a user session using the chglogon command in CMD by executing the following command:

Terminal window
chglogon --chgpwd
  • Change the currently logged-on user
  • Automate user switching tasks