Skip to content

Instantly share code, notes, and snippets.

View albertopasqualetto's full-sized avatar

Alberto Pasqualetto albertopasqualetto

View GitHub Profile
@albertopasqualetto
albertopasqualetto / request admin permissions.bat
Last active March 5, 2022 00:16
batch code to request admin previleges, if no admin previleges
:: Source: https://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file
:: Source: https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights
:: batch code to request admin previleges, if no admin previleges
fltmc >nul 2>&1
if NOT %errorLevel% == 0 (
powershell start -verb runas '%0' am_admin & exit /b
)
@albertopasqualetto
albertopasqualetto / remove git here.reg
Created August 22, 2021 11:40
Removes "git here" in contextual menu
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\git_gui]
[-HKEY_CLASSES_ROOT\Directory\shell\git_shell]
[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\git_gui]
[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\git_shell]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_gui]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_shell]
; .bat version below
@albertopasqualetto
albertopasqualetto / OneNoteDisableOSK.bat
Created April 8, 2021 15:57
Launches OneNote UWP and also the old On Screen Keyboard in order to prevent popups during handwriting
@echo off
explorer.exe shell:appsFolder\Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim
START /MIN C:\Windows\system32\osk.exe
exit
REM "C:\Windows\System32\cmd.exe" /k explorer.exe shell:appsFolder\Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim & "C:\Windows\system32\osk.exe"