Forked from The-Running-Dev/Set-LnkToRunAsAdmin.ps1
Created
February 6, 2025 08:44
-
-
Save pa-0/0e4d82a1862e478bf0b185b36ece66fe to your computer and use it in GitHub Desktop.
Modify Link to run as admin
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
$linkFilePath = "C:\Users\$([Environment]::UserName)\Desktop\WindowsTerminal.lnk" | |
$bytes = [System.IO.File]::ReadAllBytes($linkFilePath) | |
$bytes[0x15] = $bytes[0x15] -bor 0x20 #set byte 21 (0x15) bit 6 (0x20) ON | |
[System.IO.File]::WriteAllBytes($linkFilePath, $bytes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment