Skip to content

Instantly share code, notes, and snippets.

@Postrediori
Last active November 9, 2024 20:23
Show Gist options
  • Save Postrediori/70c3db1c9488fd00fa18b4e76c90caed to your computer and use it in GitHub Desktop.
Save Postrediori/70c3db1c9488fd00fa18b4e76c90caed to your computer and use it in GitHub Desktop.
Windows HowTos

Windows HowTos

Contents

Explorer and UI

Force "Details" folder view to show standard columns in folders with music files

  • Go in to the folder's Properties
  • Select the Customize tab
  • Under the section What kind of folder do you want? change the Optimize this folder for: option from Music to General Items.

Source: https://superuser.com/a/1478697/1860262

Disable web search in the start menu

In registry

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search

Make new DWORD (32-bit) BingSearchEnabled and set it to 0.

Part 2

In registry folder

HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer

Make new DWORD(32-bit) called DisableSearchBoxSuggestions and set it to 1.

Networking

Enable incoming ping

  • Open Windows Defender Firewall with Advanced Security by running WF.msc
  • In Inbound rules folder navigate to File and Printer Sharing (Echo Request ICMP...-In)

To filter IP addresses that are allowed to ping the machine

  • Open Properties of the rule
  • On the Scopes tab under Remote IP addresses list click Add and specify the IP address

Source: https://theitbros.com/allow-ping-icmp-echo-requests-on-windows-firewall/

Redirect IP in Windows

Identify loopback Idx (first column):

netsh int ip sh int

Add redirect rule:

netsh int ip add addr <IDX> <IP>/32 st=ac sk=tr

Verify that it works by running a sniffer or from command line

tracert -d <IP>

Remove the rule:

netsh int ip delete addr <IDX> <IP>

Source: https://serverfault.com/a/712997/480471

Power management (Windows 11)

Lock account and sleep when closing the laptop lid

Lock account

Navigate to Settings -> Accounts -> Sign-in options.

Under Additional settings set the parameter If you're been away, when should Windows require you to sign in again? to Every time.

Set Lid Close Action to Sleep

Open the Local Group Policy Editor gpedit.msc

Navigate to Computer Configuration -> Administrative Templates -> System -> Power Management -> Button Settings

Edit the following policies in Button Settings:

  • Select the lid switch action (plugged in)
  • Select the lid switch action (on battery)

Double click on the policy name, set it to Enabled and Lid Close Action parameter to Sleep.

Link: https://www.elevenforum.com/t/change-lid-close-action-in-windows-11.3356/#Six

Disable Modern Standby

This settings will set Standby (S3) as default standby mode and will bring back Power Management tab in device properties of Device Manager.

Open Registry Editor and navigate to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power

Create the following keys:

  • CsEnabled, type DWORD, value 0
  • PlatformAoAcOverride, type DWORD, value 0

Restart the system (Doing manual shut down and start won't apply the settings).

After that Standby (S3) will be listed in output of powercfg /a:

> powercfg /a
The following sleep states are available on this system:
    Standby (S3)
    Hibernate
    Fast Startup

And it Power Management tab in Device Manager will be available:

Power Management screenshot

Return Hibernate button to shutdown options

  • Open classic Control Panel (e.g. by control command).
  • Navigate to Power Options - Choose what the power buttons do and click Change settings that are currently unavailable
  • Enable Hibernate under Shutdown settings

Restore Missing Power Plans

Run in cmd with Administrator priviliges:

powercfg -duplicatescheme a1841308-3541-4fab-bc81-f71556f20b4a
powercfg -duplicatescheme 381b4222-f694-41f0-9685-ff5bb260df2e
powercfg -duplicatescheme 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61

Source: https://appuals.com/how-to-restore-missing-power-plan-options-on-windows-10/

Create battery report

Enter in commandline with Admin permissions:

powercfg /batteryreport /output "C:\battery_report.html"

Source: https://support.microsoft.com/en-us/windows/caring-for-your-battery-in-windows-2db3e37f-5e7d-488e-9086-ed15320519e4

Install custom fonts

  • Copy user fonts to %LOCALAPPDATA%\Microsoft\Windows\Fonts. Fonts folder may be absent by-default.
  • Open registry folder HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts and add string parameters (REG_SZ):
    • Name - font title
    • Value - full font file path

Uninstallation is done in reverse order:

  • Remove font item from registry and reboot the system
  • Remove files from %LOCALAPPDATA%\Microsoft\Windows\Fonts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment