From 1337ac435997bc841f6804148a2f6cb3ca81178a Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Thu, 21 Mar 2024 22:59:10 +0000 Subject: [PATCH] Compile Winutil --- winutil.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/winutil.ps1 b/winutil.ps1 index 654def3d..1fcf478a 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -1370,6 +1370,13 @@ function New-FirstRun { $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" # Save the shortcut $shortcut.Save() + + # Make the shortcut have 'Run as administrator' property on + $bytes = [System.IO.File]::ReadAllBytes($shortcutPath) + # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex + $bytes[0x15] = $bytes[0x15] -bor 0x20 + [System.IO.File]::WriteAllBytes($shortcutPath, $bytes) + Write-Host "Shortcut created at: $shortcutPath" # # Done create WinUtil shortcut on the desktop