07-21-2023, 11:07 AM
In my PowerShell script, I create a shortcut to a .exe (using something similar to the answer from [this question][1]):
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\ColorPix.lnk")
$Shortcut.TargetPath = "C:\Program Files (x86)\ColorPix\ColorPix.exe"
$Shortcut.Save()
Now, when I create the shortcut, how do I add to the script to make it default to running as Administrator?
[1]:
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\ColorPix.lnk")
$Shortcut.TargetPath = "C:\Program Files (x86)\ColorPix\ColorPix.exe"
$Shortcut.Save()
Now, when I create the shortcut, how do I add to the script to make it default to running as Administrator?
[1]:
[To see links please register here]
"this question"