1

I'm trying to get consistent look&feel of cmd.exe and powershell.exe in Windows 10.

Using information from: https://blogs.msdn.microsoft.com/commandline/2017/06/20/understanding-windows-console-host-settings/

Where a Console's settings are loaded-from and/or persisted-to is decided upon based upon the following hierarchy:

  • Hardcoded settings in conhostv2.dll
  • User's configured Console defaults, stored as values in 'HKCU\Console'
  • Per-Console-application registry settings, stored as sub-keys of 'HKCU\Console\' using one of two sub-key names:
    • Console application path (replacing '\' with '_')
    • Console title
  • Windows shortcut (.lnk) files

I have modified the registry in:
\HKEY_CURRENT_USER\Console to set colors, size and font of cmd.exe
and:
\HKEY_CURRENT_USER\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe
\HKEY_CURRENT_USER\Console\%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe
to have a different background color in powershell.exe but the font and window size is inherited from cmd.exe.

This works great for cmd.exe started in any way and for PS started from Explorer > File > Open Windows PowerShell

However, I have problem changing links from Start Menu > Windows PowerShell

These .lnk files have colors set and don't use registry settings. I tried recreating the link and set its path to %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe, it works but uses setting from the registry for Command Prompt and not settings for PowerShell.

Is it possible to remove console setting from .lnk file?

1

Just set this in your PoSH profiles. No need to mess with the registry or any .lnk file. Your profile takes precedence.

Persistent PowerShell: The PowerShell Profile

You can mould PowerShell to the way you want to work, with all the settings and modules that you require, by using the profiles. Profiles are PowerShell scripts that run at startup, and once you have understood where they are and when each is used, they have a whole range of uses that make using PowerShell a lot more convenient.

https://www.red-gate.com/simple-talk/sysadmin/powershell/persistent-powershell-the-powershell-profile/

Protip December: Customize your Powershell profile https://thepracticalsysadmin.com/customize-your-powershell-profile

Create a Really Cool PowerShell ISE Profile https://blogs.technet.microsoft.com/heyscriptingguy/2011/10/21/create-a-really-cool-powershell-ise-profile

What’s in Your PowerShell Profile? Powershell Team Favorites https://blogs.technet.microsoft.com/heyscriptingguy/2014/05/24/whats-in-your-powershell-profile-powershell-team-favorites

0

Came here with the same question. What you need is concfg.

The only thing is it's not so straightforward to install without Scoop but that's also an excellent tool to get into.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.