Skip to content

Instantly share code, notes, and snippets.

@bp2008
Last active December 13, 2023 16:44
Show Gist options
  • Save bp2008/ced5615c6718e35e075d7cabdcdaa7ca to your computer and use it in GitHub Desktop.
Save bp2008/ced5615c6718e35e075d7cabdcdaa7ca to your computer and use it in GitHub Desktop.

Windows Tips

Sign-in automatically

The procedure to set up automatic sign-in is easy:

Run control userpasswords2 or netplwiz to open a special "User Accounts" dialog. Find the option "Users must enter a user name and password to use this computer". Uncheck this, then click OK and you will be prompted to enter credentials.

That checkbox might be missing

Windows 10 2004 has hidden this checkbox by default. To fix that, disable the "Require Windows Hello sign-in for Microsoft accounts" feature in the Settings app. If you can't find that (Windows 10 2009 a.k.a. 20H2), there are several ways forward. I'm documenting them all here for completeness:

Solution A) Try to restore the checkbox via registry modification

Via command

reg ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v DevicePasswordLessBuildVersion /t REG_DWORD /d 0 /f

Or via manual registry modification

  1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device
  2. Find the DevicePasswordLessBuildVersion of type REG_DWORD. It is expected to have a value of 2. Set it to 0.

The checkbox should be restored, and the normal automatic sign-in procedure should be available.

Solution B) Autologon tool

This tool evidently sets up automatic sign-in without having to change the DevicePasswordLessBuildVersion flag: https://docs.microsoft.com/en-us/sysinternals/downloads/autologon

Solution C) Manual registry modification

If none of the above works, this probably won't either. But you can try editing the registry manually to configure automatic sign-in. This is the least secure option, because it puts your password into the registry in plain text whereas the previous options encrypt your password and store it elsewhere (I don't know where).

  1. Run regedit
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Add string key AutoAdminLogon with value 1.
  4. Add string key DefaultDomainName with value matching the computer's name.
  5. Add string key DefaultUserName with value matching the user name you want to log in with automatically.
  6. Add string key DefaultPassword with value matching the user's password.

System process listening on your port?

If Resource Monitor tells you that System (often PID 4) is listening on the port you want, run netsh http show servicestate to learn more about what is actually listening on your port. netstat -abn is also supposed to be helpful, but not in my experience so far.

You can also look in the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters\UrlAclInfo.

Certificate Store Management

Access Current User's certificate store via certmgr.msc or Local Machine's certificate store via certlm.msc.

Set Network to Private

If the Windows GUI is not letting you change a public network to private, you can use Powershell.

Run PS as administrator.

Run Get-NetConnectionProfile

Run Set-NetConnectionProfile -Name "NetworkName" -NetworkCategory Private (Replace NetworkName with the value of the Name field shared by the previous command.)

Add Static IP Alias to DHCP Interface

  1. Discover Interface Names:

    netsh interface ipv4 show interface
    
  2. Enable dhcpstaticipcoexistence:

    netsh interface ipv4 set interface interface="INTERFACE NAME" dhcpstaticipcoexistence=enabled
    
  3. Add a static ip address:

    netsh interface ipv4 add address "INTERFACE NAME" 192.168.x.xxx 255.255.255.0
    

Addresses added via this method are not expected to appear in the GUI. Instead, use ipconfig or ipconfig /all to see them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment