All gists

wthiel
Last active 4 months ago powershell

This script ensures that it runs with administrator privileges before executing the actual code. If no admin rights are available, it restarts itself with elevated privileges.

0 0 1
1 param([switch]$Elevated)
2
3 function Test-Admin {
4 $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
5 $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
6 }
7
8 if ((Test-Admin) -eq $false) {
9 if ($elevated) {
10 # tried to elevate, did not work, aborting
wthiel
Last active 4 months ago autohotkey

This script sends clipboard text as keystrokes with Ctrl+Shift+V. Useful when native paste doesn't work (e.g. SSH, RDP).

0 0 1
1 ;--------------------------------------------------------------
2 ; This script sends clipboard text as keystrokes with Ctrl+Shift+V.
3 ; Useful when native paste doesn't work (e.g. SSH, RDP).
4 ; Features:
5 ; - Shows a tooltip if the clipboard is empty.
6 ; - Adjustable SetKeyDelay for terminals that need slower input.
7 ; - Does NOT override normal Ctrl+V.
8 ;--------------------------------------------------------------
9
10 ; Adjust key delay here (ms between keys, ms press duration):