disable quick edit #46

Closed
opened 2024-09-07 18:54:20 +02:00 by Anri · 2 comments
Owner
https://stackoverflow.com/a/78505203/15436737
Anri added the
windows
label 2024-09-07 18:54:20 +02:00
Author
Owner

cf MAS:

::  Disable QuickEdit in current session


set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);"
set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);"
set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);"
set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);"


%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1)
:skipQE
cf [MAS](https://github.com/massgravel/Microsoft-Activation-Scripts/blob/c75cd29b9fda945df18a72bccf17fab56868a261/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd#L268): ```cmd :: Disable QuickEdit in current session set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" %launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ```
Anri closed this issue 2024-09-10 13:12:29 +02:00
Author
Owner

won't add

won't add
Sign in to join this conversation.
No labels
arch
windows
wsl
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Anri/confOS#46
No description provided.