Last active
July 7, 2020 19:13
-
-
Save juliancruzsanchez/e5f6302f8e234953a7c5e917b8de78a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$t = '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);' | |
add-type -name win -member $t -namespace native | |
[native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | |
cd C:\ | |
if ([string]::IsNullOrEmpty((Get-PnpDevice | Where-Object {$_.name -match "HID-compliant touch pad" } | Where-Object {$_.instanceId -match "HID\\VID" } | Where-Object {$_.status -match "OK" }))) { | |
if ((Get-ItemProperty -path 'HKLM:\System\CurrentControlSet\Control\PriorityControl' -Name 'ConvertibleSlateMode').ConvertibleSlateMode -eq 1) { | |
Set-ItemProperty -path 'HKLM:\System\CurrentControlSet\Control\PriorityControl' -Name 'ConvertibleSlateMode' -value 0 | |
} | |
} else { | |
if ((Get-ItemProperty -path 'HKLM:\System\CurrentControlSet\Control\PriorityControl' -Name 'ConvertibleSlateMode').ConvertibleSlateMode -eq 0) { | |
Set-ItemProperty -path 'HKLM:\System\CurrentControlSet\Control\PriorityControl' -Name 'ConvertibleSlateMode' -value 1 | |
} | |
} | |
Start-Sleep -milliseconds 1500 | |
.\KB_Detect.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment