0

Does anyone know how to enable or disable programmatically the "Quick Edit Mode" in PowerShell or CMD console ?
I would like to lauch PowerShell from a script (batch) and to give the same look and behavior as the default PowerShell console lauched from the shortcut.

Nicolas
  • 6,039
  • 4
  • 32
  • 49
  • See an easy solution on bellow Stack OverFlow question: http://stackoverflow.com/questions/30872345/script-commands-to-disable-quick-edit-mode – Krisz Mar 15 '17 at 08:50

2 Answers2

0

Already answered here, update "QuickMode" setting in Windows Registry:

reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f

However it will not affect currently opened window. But you can reopen a window:

:: Get QuickEdit Mode setting from Windows Registry
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKCU\Console" /v QuickEdit`) DO (
  set quickEditSetting=%%A %%B
)

if %quickEditSetting% == 0x0 (
  :: Disable QuickEdit Mode
  reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f

  :: Open script in a new Command Prompt window
  start "" "%~dpnx0" %* && exit
)

... script logic here ...
exit

Additional info about HKEY_CURRENT_USER\Console Registry configuration - https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_CURRENT_USER/console/index

viachm
  • 21
  • 3
0

Try to set/create a QuickEdit DWord value with value of 1 under the following regkey:

HKEY_CURRENT_USER\Console\<look for powershell related key>
Shay Levy
  • 114,369
  • 30
  • 175
  • 198