Disable UAC Prompt for a Single Application
A useful KB (946932) just got posted on support.microsoft.com. It describes how to disable the User Account Control (UAC) prompt for a specific application, without disabling it for the machine as a whole. Now THAT's useful. There's no way I'm ever going to run with UAC off. But there are definitely a couple of applications where I find the UAC prompt really annoying, since I use them pretty often.
BTW, there's another way I like to use as well. I open a PowerShell window, as administrator, at the beginning of every session. I have my Profile.ps1 set to change the background colour to a dark red whenever I'm running from an elevated prompt, just so I don't use it unintentionally, and I have aliases set up in PowerShell to start some key applications that I know need elevation. Since I'm already elevated, I don't get prompted again. :)
Here's the code for my prompt and window colours, if you're interested:
if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) -and ( $build -eq 6000 ))
{
$effectivename = "Administrator"
$host.UI.RawUI.Backgroundcolor="DarkRed"
clear-host
}else
{
$effectivename = $id.name
$host.UI.RawUI.Backgroundcolor="White"
$host.UI.RawUI.Foregroundcolor="DarkBlue"
clear-host
}
function prompt
{
$host.ui.rawui.WindowTitle = " [" + $HostName + "] (" + $effectivename + ")"
if ( $effectivename -eq "Administrator" ) {
write-host ("[") -nonewline -foregroundcolor red
write-host ($Hostname) -nonewline -foregroundcolor Magenta
write-host ("]") -nonewline -foregroundcolor Red
Write-Host ([string]$(get-location) +":") -foregroundcolor Green
write-host ("PS >" ) -nonewline -foregroundcolor White
} else
{
write-host ("[") -nonewline -foregroundcolor red
write-host ($Hostname) -nonewline -foregroundcolor Magenta
write-host ("]") -nonewline -foregroundcolor Red
Write-Host ([string]$(get-location) +":") -foregroundcolor DarkGreen
write-host ("PS >" ) -nonewline -foregroundcolor DarkBlue
# write-host (" >" ) -nonewline -foregroundcolor White
}
return " "
}
Charlie.